Skip to content

Commit cf35be3

Browse files
committed
fix a performance bug in drop
1 parent 585450f commit cf35be3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/algorithm/dyadic/structure.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,10 +756,10 @@ impl<T: ArrayValue> Array<T> {
756756
let row_count = self.row_count();
757757
let abs_dropping = dropping.unsigned_abs().min(row_count);
758758
if dropping >= 0 {
759-
self.data.as_mut_slice().rotate_left(abs_dropping * row_len);
759+
self.data = self.data.slice(abs_dropping * row_len..)
760+
} else {
760761
self.data.truncate((row_count - abs_dropping) * row_len);
761762
}
762-
self.data.truncate((row_count - abs_dropping) * row_len);
763763
if self.shape.is_empty() {
764764
self.shape.push(1);
765765
}

0 commit comments

Comments
 (0)