Skip to content

Commit e65dc1c

Browse files
committed
performance lint
1 parent ef94843 commit e65dc1c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

+stdlib/+hdf5nc/auto_chunk_size.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
TYPESIZE = 8; % bytes, assume real64 for simplicity
1818

1919
csize = dims;
20-
Ndim = length(dims);
21-
if Ndim == 1 || prod(dims) * TYPESIZE < CHUNK_MIN
20+
21+
if isscalar(dims) || prod(dims) * TYPESIZE < CHUNK_MIN
2222
return
2323
end
2424

@@ -33,7 +33,7 @@
3333
i = 0;
3434
while true
3535
% Repeatedly loop over the axes, dividing them by 2.
36-
% Stop when:
36+
% Stop when:
3737
% 1a. We're smaller than the target chunk size, OR
3838
% 1b. We're within 50% of the target chunk size, AND
3939
% 2. The chunk is smaller than the maximum chunk size
@@ -50,7 +50,7 @@
5050
break
5151
end
5252
% Element size larger than CHUNK_MAX
53-
j = mod(i, Ndim) + 1;
53+
j = mod(i, length(dims)) + 1;
5454
csize(j) = ceil(csize(j) / 2);
5555
i = i+1;
5656
end

0 commit comments

Comments
 (0)