| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Testing when the allocation to first element offset is nonzero.
|
Rebased, resolved conflict, added test for nonzero alloc to first element pointer |
Sorry, something went wrong.
|
Thanks a lot for this |
Sorry, something went wrong.
| pub fn reserve(&mut self, axis: Axis, additional: usize) -> Result<(), ShapeError> | ||
| where D: RemoveAxis | ||
| { | ||
| debug_assert!(axis.index() < self.ndim()); |
There was a problem hiding this comment.
Why was the branch that returned early on additional == 0 removed?
Sorry, something went wrong.
There was a problem hiding this comment.
No reason to hold up the PR on this question I think 🙂
Sorry, something went wrong.
There was a problem hiding this comment.
Why was the branch that returned early on additional == 0 removed?
I think that was because it was faster (at least on my machine) without it, but it's been a while so could be worth re-testing with it in.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This PR adds an array.reserve(axis, additional) method for use when appending multiple times to an array.
It abstracts over the code in append that was calling OwnedRepr::reserve in order to expose it.
Benchmark results (appending 100 times to an empty array):
Note I'm new to the crate so I may have missed something, but happy to iterate if there's more to do.