summary refs log tree commit diff
path: root/src/libcore/slice
AgeCommit message (Collapse)AuthorLines
2017-04-09Move away from the ad-hoc NoDrop unionsSimonas Kazlauskas-18/+12
2017-04-08slice: Implement .rfind() for slice iterators Iter and IterMutUlrik Sverdrup-0/+13
Just like the forward case find, implement rfind explicitly
2017-04-05Rollup merge of #41065 - jorendorff:slice-rsplit-41020, r=alexcrichtonAriel Ben-Yehuda-17/+148
[T]::rsplit() and rsplit_mut(), #41020
2017-04-05Rollup merge of #40943 - Amanieu:offset_to, r=alexcrichtonAriel Ben-Yehuda-3/+4
Add ptr::offset_to This PR adds a method to calculate the signed distance (in number of elements) between two pointers. The resulting value can then be passed to `offset` to get one pointer from the other. This is similar to pointer subtraction in C/C++. There are 2 special cases: - If the distance is not a multiple of the element size then the result is rounded towards zero. (in C/C++ this is UB) - ZST return `None`, while normal types return `Some(isize)`. This forces the user to handle the ZST case in unsafe code. (C/C++ doesn't have ZSTs)
2017-04-04simplify implementation of [T]::splitn and friends #41020Jason Orendorff-17/+9
2017-04-04add [T]::rsplit() and rsplit_mut() #41020Jason Orendorff-0/+139
2017-04-03Add ptr::offset_toAmanieu d'Antras-3/+4
2017-03-31Auto merge of #40737 - nagisa:safe-slicing-strs, r=BurntSushibors-28/+24
Checked slicing for strings cc https://github.com/rust-lang/rust/issues/39932
2017-03-28libcore: sort_unstable: remove unnecessary loop.Vadzim Dambrouski-1/+3
`other` is guaranteed to be less than `2 * len`.
2017-03-26libcore: sort_unstable: improve randomization in break_patterns.Vadzim Dambrouski-24/+32
Select 3 random points instead of just 1. Also the code now compiles on 16bit architectures.
2017-03-25Optimize insertion sortStjepan Glavina-2/+2
This change slightly changes the main iteration loop so that LLVM can optimize it more efficiently. Benchmark: name before ns/iter after ns/iter diff ns/iter diff % slice::sort_unstable_small_ascending 39 (2051 MB/s) 38 (2105 MB/s) -1 -2.56% slice::sort_unstable_small_big_random 579 (2210 MB/s) 575 (2226 MB/s) -4 -0.69% slice::sort_unstable_small_descending 80 (1000 MB/s) 70 (1142 MB/s) -10 -12.50% slice::sort_unstable_small_random 396 (202 MB/s) 386 -10 -2.53%
2017-03-22Checked (and unchecked) slicing for strings?Simonas Kazlauskas-28/+24
What is this magic‽
2017-03-22Various fixes to wording consistency in the docsStjepan Glavina-7/+7
2017-03-21Unit test heapsortStjepan Glavina-2/+11
2017-03-21Use partial insertion sortStjepan Glavina-54/+119
2017-03-21Tweak the constants a bitStjepan Glavina-5/+5
2017-03-21Fix grammarStjepan Glavina-3/+3
2017-03-21Faster sort_unstable on presorted inputsStjepan Glavina-13/+21
2017-03-21Address Alex's PR commentsStjepan Glavina-2/+0
2017-03-21Implement feature sort_unstableStjepan Glavina-0/+3088