diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 7e0b40b..7ecc195 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1002,7 +1002,7 @@ fn add_examples(all_batches: &mut [Batch], examples: &[Example]) { .into_iter() .map(|(_, ex)| ex) .collect::<Vec<_>>(); - candidates.shuffle(&mut thread_rng()); + candidates.sort_by_key(|ex| fasthash::metro::hash64(ex.ja.as_bytes())); batch.extra_examples.clear(); let mut in_batch = Charset::from_iter(batch.examples.iter().map(|x| x.chars.chars().iter().copied()).flatten()); @@ -1020,7 +1020,7 @@ fn add_examples(all_batches: &mut [Batch], examples: &[Example]) { } } - batch.extra_examples.shuffle(&mut thread_rng()); + batch.extra_examples.sort_by_key(|ex| fasthash::metro::hash64(ex.ja.as_bytes())); println!("---- BATCH #{:03} ----", i); for ex in batch.extra_examples.iter() { |