Skip to content

Commit ba01acd

Browse files
N5N3johnnychen94
andcommitted
Add more comments.
Co-Authored-By: Johnny Chen <[email protected]>
1 parent 3b7062c commit ba01acd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

base/multidimensional.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,9 @@ module IteratorsMD
416416
# current column is consumed. The implementation is written recursively to achieve this.
417417
# `iterate` returns `Union{Nothing, Tuple}`, we explicitly pass a `valid` flag to eliminate
418418
# the type instability inside the core `__inc` logic, and this gives better runtime performance.
419+
# The third argument ndim is used to preserve the original dimension information to help
420+
# elliminate unnecessary boundary checks and thus enable vectorization -- this makes low
421+
# dimensional case, especially 1d and 2d, much happier.
419422
__inc(::Tuple{}, ::Tuple{}, ::Val) = false, ()
420423
@inline function __inc(state::Tuple{Int}, indices::Tuple{OrdinalRangeInt}, ::Val{N}) where {N}
421424
rng = indices[1]

0 commit comments

Comments
 (0)