Commit 4057ef5
committed
Fix
In the case of an unfused iterator yielding exactly k-1 elements, then None, then other elements, the heap is k-1 long and `for_each` is called on the other elements leading `debug_assert_eq` to rightfully panic.
Our recent variants of `k_smallest` do not have this bug!Itertools::k_smallest on unfused iterators1 parent 8ed734b commit 4057ef5
1 file changed
+11
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2965 | 2965 | | |
2966 | 2966 | | |
2967 | 2967 | | |
2968 | | - | |
2969 | | - | |
2970 | | - | |
2971 | | - | |
2972 | | - | |
2973 | | - | |
2974 | | - | |
2975 | | - | |
2976 | | - | |
| 2968 | + | |
| 2969 | + | |
| 2970 | + | |
| 2971 | + | |
| 2972 | + | |
| 2973 | + | |
| 2974 | + | |
| 2975 | + | |
| 2976 | + | |
| 2977 | + | |
| 2978 | + | |
2977 | 2979 | | |
2978 | 2980 | | |
2979 | 2981 | | |
| |||
0 commit comments