Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add next_permutation and prev_permutation onto MutableOrdVector<T>.
Unlike ImmutableClonableVector::permutations() which returns an iterator, cloning the entire array each iteration, these methods mutate the vector in-place. For that reason, these methods are much faster; between 35-55 times faster, depending on the benchmark. They also generate permutations in lexicographical order.
- Loading branch information
Showing
1 changed file
with
142 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3b5d6fd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at https://github.com/exscape/rust-fork/commit/3b5d6fd25486b29a70adfda6cb917ced614bc6d2
3b5d6fd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging exscape/rust-fork/master = 3b5d6fd into auto
3b5d6fd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exscape/rust-fork/master = 3b5d6fd merged ok, testing candidate = 67aa8c70
3b5d6fd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some tests failed:
failure: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/5243
exception: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/6057
exception: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/5160
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/6155
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/5243
exception: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/5251
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/6157
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/5242
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/5248
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android/builds/5308
exception: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/3044
exception: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/6147
exception: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/5258
3b5d6fd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
saw approval from alexcrichton
at https://github.com/exscape/rust-fork/commit/3b5d6fd25486b29a70adfda6cb917ced614bc6d2
3b5d6fd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merging exscape/rust-fork/master = 3b5d6fd into auto
3b5d6fd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exscape/rust-fork/master = 3b5d6fd merged ok, testing candidate = 7645982
3b5d6fd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all tests pass:
success: http://buildbot.rust-lang.org/builders/auto-mac-32-opt/builds/6058
success: http://buildbot.rust-lang.org/builders/auto-mac-64-opt/builds/6056
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-c/builds/5152
success: http://buildbot.rust-lang.org/builders/auto-mac-64-nopt-t/builds/5161
success: http://buildbot.rust-lang.org/builders/auto-linux-32-opt/builds/6156
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-c/builds/5244
success: http://buildbot.rust-lang.org/builders/auto-linux-32-nopt-t/builds/5252
success: http://buildbot.rust-lang.org/builders/auto-linux-64-opt/builds/6158
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-c/builds/5243
success: http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/5249
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android/builds/5309
success: http://buildbot.rust-lang.org/builders/auto-linux-64-x-android-t/builds/3045
success: http://buildbot.rust-lang.org/builders/auto-win-32-opt/builds/6148
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-c/builds/5244
success: http://buildbot.rust-lang.org/builders/auto-win-32-nopt-t/builds/5259
3b5d6fd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fast-forwarding master to auto = 7645982