fix empty iterator crash, restart
This commit is contained in:
parent
6a042da5c1
commit
a328ddfd5f
@ -1,5 +1,5 @@
|
||||
import csv
|
||||
def_flags="--no-default-features --features std,snapshot_restore,singlecore"
|
||||
def_flags="--no-default-features --features std,snapshot_restore,singlecore,restarting"
|
||||
remote="mnt/"
|
||||
|
||||
rule build_showmap:
|
||||
|
@ -305,11 +305,13 @@ where
|
||||
let untouched : Vec<_> = marks.iter().filter(
|
||||
|x| x.2 == 0
|
||||
).collect();
|
||||
let tmp = interrupt_offsets[i];
|
||||
let choice = myrand.choose(untouched);
|
||||
interrupt_offsets[i] = myrand.between(choice.0.start_tick, choice.0.end_tick)
|
||||
.try_into().expect("tick > u32");
|
||||
do_rerun = true;
|
||||
if untouched.len() > 0 {
|
||||
let tmp = interrupt_offsets[i];
|
||||
let choice = myrand.choose(untouched);
|
||||
interrupt_offsets[i] = myrand.between(choice.0.start_tick, choice.0.end_tick)
|
||||
.try_into().expect("tick > u32");
|
||||
do_rerun = true;
|
||||
}
|
||||
// println!("no alternatives, choose random i: {} {} -> {}",i,tmp,interrupt_offsets[i]);
|
||||
continue;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user