summary refs log tree commit diff
path: root/src/libcollections/tests/slice.rs
AgeCommit message (Collapse)AuthorLines
2017-05-21Stop returning k from [T]::rotateScott McMurray-2/+1
2017-05-21Add an in-place rotate method for slices to libcoreScott McMurray-0/+36
A helpful primitive for moving chunks of data around inside a slice. In particular, adding elements to the end of a Vec then moving them somewhere else, as a way to do efficient multiple-insert. (There's drain for efficient block-remove, but no easy way to block-insert.) Talk with another example: <https://youtu.be/qH6sSOr-yk8?t=560>
2017-05-04Make [u8]::reverse() 5x fasterScott McMurray-0/+10
Since LLVM doesn't vectorize the loop for us, do unaligned reads of a larger type and use LLVM's bswap intrinsic to do the reversing of the actual bytes. cfg!-restricted to x86 and x86_64, as I assume it wouldn't help on things like ARMv5. Also makes [u16]::reverse() a more modest 1.5x faster by loading/storing u32 and swapping the u16s with ROT16. Thank you ptr::*_unaligned for making this easy :)
2017-04-03Move libXtest into libX/testsStjepan Glavina-0/+1180
This change moves: 1. `libcoretest` into `libcore/tests` 2. `libcollectionstest` into `libcollections/tests` This is a follow-up to #39561.