-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add slice::ExactChunks and ::ExactChunksMut iterators #47126
Commits on Jan 13, 2018
-
Add slice::ExactChunks and ::ExactChunksMut iterators
These guarantee that always the requested slice size will be returned and any leftoever elements at the end will be ignored. It allows llvm to get rid of bounds checks in the code using the iterator. This is inspired by the same iterators provided by ndarray. See rust-lang#47115
Configuration menu - View commit details
-
Copy full SHA for 51d546f - Browse repository at this point
Copy the full SHA 51d546fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 83396fc - Browse repository at this point
Copy the full SHA 83396fcView commit details -
Configuration menu - View commit details
-
Copy full SHA for 802ba9e - Browse repository at this point
Copy the full SHA 802ba9eView commit details -
Configuration menu - View commit details
-
Copy full SHA for e51a89a - Browse repository at this point
Copy the full SHA e51a89aView commit details -
Apply review comments from @bluss
- Simplify nth() by making use of the fact that the slice is evenly divisible by the chunk size, and calling next() instead of duplicating it - Call next_back() in last(), they are equivalent - Implement ExactSizeIterator::is_empty()
Configuration menu - View commit details
-
Copy full SHA for aa0c08a - Browse repository at this point
Copy the full SHA aa0c08aView commit details -
Configuration menu - View commit details
-
Copy full SHA for cea36f4 - Browse repository at this point
Copy the full SHA cea36f4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6bf1dfd - Browse repository at this point
Copy the full SHA 6bf1dfdView commit details -
Mention in the exact_chunks docs that this can often be optimized bet…
…ter by the compiler And also link from the normal chunks iterator to the exact_chunks one.
Configuration menu - View commit details
-
Copy full SHA for 8a82e8e - Browse repository at this point
Copy the full SHA 8a82e8eView commit details -
Use assert_eq!() instead of assert!(a == b) in slice chunks_mut() uni…
…t test This way more useful information is printed if the test ever fails.
Configuration menu - View commit details
-
Copy full SHA for baa81dc - Browse repository at this point
Copy the full SHA baa81dcView commit details -
Test the whole chunks instead of just an element in the chunks/chunks…
…_mut tests Easy enough to do and ensures that the whole chunk is as expected instead of just the element that was looked at before.
Configuration menu - View commit details
-
Copy full SHA for ed77483 - Browse repository at this point
Copy the full SHA ed77483View commit details -
Add unit tests for exact_chunks/exact_chunks_mut
These are basically modified copies of the chunks/chunks_mut tests.
Configuration menu - View commit details
-
Copy full SHA for 5f4fc82 - Browse repository at this point
Copy the full SHA 5f4fc82View commit details