Skip to content

Commit

Permalink
♻️ Optimize record selection in select_record_from_fq_by_random funct…
Browse files Browse the repository at this point in the history
…ion using for loop
  • Loading branch information
cauliyang committed Jan 22, 2025
1 parent 3a793df commit 80a4563
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/deepbiop-fq/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ pub fn select_record_from_fq_by_random<P: AsRef<Path>>(
}

// Process remaining elements with reservoir sampling
while let Some(record) = records_iter.next() {
for record in records_iter {
count += 1;
let j = rng.gen_range(0..count);
if j < numbers {
Expand Down

0 comments on commit 80a4563

Please sign in to comment.