File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -346,15 +346,15 @@ where
346
346
let k = indices. as_mut ( ) . len ( ) ;
347
347
let total = checked_binomial ( n, k) . expect ( OVERFLOW_MSG ) ;
348
348
match offset. cmp ( & total) {
349
- Ordering :: Less => {
349
+ Ordering :: Equal => {
350
350
unrank ( indices. as_mut ( ) , offset - 1 , n) ;
351
351
Self {
352
352
indices,
353
353
n,
354
354
position : IndicesPosition :: End ,
355
355
}
356
356
}
357
- Ordering :: Equal => {
357
+ Ordering :: Less => {
358
358
unrank ( indices. as_mut ( ) , offset, n) ;
359
359
Self {
360
360
indices,
@@ -549,6 +549,8 @@ fn decrement_indices(indices: &mut [usize], n: usize) {
549
549
550
550
// Decrement index, and reset the ones to its right
551
551
indices[ i] -= 1 ;
552
+ for ( j, index) in indices. iter_mut ( ) . enumerate ( ) . skip ( i + 1 ) {
553
+ * index = n - k + j;
552
554
for ( j, index) in indices. iter_mut ( ) . enumerate ( ) . skip ( i + 1 ) {
553
555
* index = n - k + j;
554
556
}
You can’t perform that action at this time.
0 commit comments