Commit 5d94660
Increment state conditionally in
Fixes #53430
```julia
julia> a = rand(100,100); b = similar(a); av = view(a, axes(a)...); bv = view(b, axes(b)...); bv2 = view(b, UnitRange.(axes(b))...);
julia> @Btime copyto!($bv2, $av); # slow, indices are UnitRanges
12.352 μs (0 allocations: 0 bytes) # master, v"1.13.0-DEV.745"
1.662 μs (0 allocations: 0 bytes) # this PR
julia> @Btime copyto!($bv, $av); # reference
1.733 μs (0 allocations: 0 bytes)
```
The performances become comparable after this PR.
I've also renamed the second `I` to `Itail`, as the two variables
represent different quantities.
(cherry picked from commit 36a4616)CartesianIndices iteration (#58742)1 parent f650e9f commit 5d94660
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | | - | |
450 | 449 | | |
| 450 | + | |
451 | 451 | | |
452 | 452 | | |
453 | | - | |
454 | | - | |
| 453 | + | |
| 454 | + | |
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
| |||
0 commit comments