Commit 36a4616
authored
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.CartesianIndices iteration (#58742)1 parent 89dfb68 commit 36a4616
1 file changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
475 | | - | |
476 | 475 | | |
| 476 | + | |
477 | 477 | | |
478 | 478 | | |
479 | | - | |
480 | | - | |
| 479 | + | |
| 480 | + | |
481 | 481 | | |
482 | 482 | | |
483 | 483 | | |
| |||
0 commit comments