Commit 5542324
committed
Fix lapse in logic of need_copy determination
Closes gh-1926
One-dimensinal contiguous arrays are both C- and F- contiguous.
The check was written with the assumption that f_contig implies
not c_contig, which is untrue for 1D arrays.
The reproducer provided in gh-1926 now outputs
```
astype time: 9.441375732421875e-05
a is a_ True
asarray time: 6.103515625e-05
a is a__ True
```
Previously, astype took several magnitudes longer due to the copy
operation performed.1 parent 04a8228 commit 5542324
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
672 | 672 | | |
673 | 673 | | |
674 | 674 | | |
675 | | - | |
676 | | - | |
677 | | - | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
678 | 678 | | |
679 | 679 | | |
680 | 680 | | |
| |||
0 commit comments