Browse Source
This changes `split_off`, which does one allocation and copies `n` items in the best case, `2 * n` items in the worst case to `retain`, which does zero allocations and copies zero items in the best case and `3 * (n - 1)` items in worst case (because swap is 3 copies and `retain` has to swap due to possibility of panic). I believe this should be net-benefit due to usually small `n`.android-patches
committed by
Roman Zeyde
1 changed files with 5 additions and 4 deletions
Loading…
Reference in new issue