Skip to content

Commit

Permalink
Link to an instability-bit-me story
Browse files Browse the repository at this point in the history
  • Loading branch information
Stjepan Glavina committed Mar 8, 2017
1 parent 7d2e940 commit d25e483
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion text/0000-unstable-sort.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ of sort algorithms like higher performance or lower memory overhead are often mo
desirable.

Having a performant, non-allocating unstable sort function in libcore would cover those
needs. At the moment Rust is not offering a built-in alternative (only crates), which
needs. At the moment Rust is not offering this solution as a built-in (only crates), which
is unusual for a systems programming language.

**Q: What is stability?**<br>
Expand Down Expand Up @@ -54,6 +54,8 @@ A: Because stability is a good default. A programmer might call a sort function
without checking in the documentation whether it is stable or unstable. It is very
intuitive to assume stability, so having `slice::sort` perform unstable sorting might
cause unpleasant surprises.
See this [story](https://medium.com/@cocotutch/a-swift-sorting-problem-e0ebfc4e46d4#.yfvsgjozx)
for an example.

**Q: Why does `slice::sort` allocate?**<br>
A: It is possible to implement a non-allocating stable sort, but it would be
Expand Down

0 comments on commit d25e483

Please sign in to comment.