@@ -270,27 +270,27 @@ pub mod val_batch {
270
270
fn work ( & mut self , source1 : & OrdValBatch < L > , source2 : & OrdValBatch < L > , fuel : & mut isize ) {
271
271
272
272
// An (incomplete) indication of the amount of work we've done so far.
273
- let starting_updates = self . result . times . len ( ) ;
273
+ let starting_updates = self . result . times . len ( ) + self . singletons ;
274
274
let mut effort = 0isize ;
275
275
276
276
// While both mergees are still active, perform single-key merges.
277
277
while self . key_cursor1 < source1. storage . keys . len ( ) && self . key_cursor2 < source2. storage . keys . len ( ) && effort < * fuel {
278
278
self . merge_key ( & source1. storage , & source2. storage ) ;
279
279
// An (incomplete) accounting of the work we've done.
280
- effort = ( self . result . times . len ( ) - starting_updates) as isize ;
280
+ effort = ( self . result . times . len ( ) + self . singletons - starting_updates) as isize ;
281
281
}
282
282
283
283
// Merging is complete, and only copying remains.
284
284
// Key-by-key copying allows effort interruption, and compaction.
285
285
while self . key_cursor1 < source1. storage . keys . len ( ) && effort < * fuel {
286
286
self . copy_key ( & source1. storage , self . key_cursor1 ) ;
287
287
self . key_cursor1 += 1 ;
288
- effort = ( self . result . times . len ( ) - starting_updates) as isize ;
288
+ effort = ( self . result . times . len ( ) + self . singletons - starting_updates) as isize ;
289
289
}
290
290
while self . key_cursor2 < source2. storage . keys . len ( ) && effort < * fuel {
291
291
self . copy_key ( & source2. storage , self . key_cursor2 ) ;
292
292
self . key_cursor2 += 1 ;
293
- effort = ( self . result . times . len ( ) - starting_updates) as isize ;
293
+ effort = ( self . result . times . len ( ) + self . singletons - starting_updates) as isize ;
294
294
}
295
295
296
296
* fuel -= effort;
@@ -864,27 +864,27 @@ pub mod key_batch {
864
864
fn work ( & mut self , source1 : & OrdKeyBatch < L > , source2 : & OrdKeyBatch < L > , fuel : & mut isize ) {
865
865
866
866
// An (incomplete) indication of the amount of work we've done so far.
867
- let starting_updates = self . result . times . len ( ) ;
867
+ let starting_updates = self . result . times . len ( ) + self . singletons ;
868
868
let mut effort = 0isize ;
869
869
870
870
// While both mergees are still active, perform single-key merges.
871
871
while self . key_cursor1 < source1. storage . keys . len ( ) && self . key_cursor2 < source2. storage . keys . len ( ) && effort < * fuel {
872
872
self . merge_key ( & source1. storage , & source2. storage ) ;
873
873
// An (incomplete) accounting of the work we've done.
874
- effort = ( self . result . times . len ( ) - starting_updates) as isize ;
874
+ effort = ( self . result . times . len ( ) + self . singletons - starting_updates) as isize ;
875
875
}
876
876
877
877
// Merging is complete, and only copying remains.
878
878
// Key-by-key copying allows effort interruption, and compaction.
879
879
while self . key_cursor1 < source1. storage . keys . len ( ) && effort < * fuel {
880
880
self . copy_key ( & source1. storage , self . key_cursor1 ) ;
881
881
self . key_cursor1 += 1 ;
882
- effort = ( self . result . times . len ( ) - starting_updates) as isize ;
882
+ effort = ( self . result . times . len ( ) + self . singletons - starting_updates) as isize ;
883
883
}
884
884
while self . key_cursor2 < source2. storage . keys . len ( ) && effort < * fuel {
885
885
self . copy_key ( & source2. storage , self . key_cursor2 ) ;
886
886
self . key_cursor2 += 1 ;
887
- effort = ( self . result . times . len ( ) - starting_updates) as isize ;
887
+ effort = ( self . result . times . len ( ) + self . singletons - starting_updates) as isize ;
888
888
}
889
889
890
890
* fuel -= effort;
0 commit comments