Skip to content

Commit

Permalink
Fix lsb_sort level skip on already_sorted counts
Browse files Browse the repository at this point in the history
  • Loading branch information
nessex committed Feb 2, 2024
2 parents efecead + 11d5f5a commit 28170aa
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 15 deletions.
23 changes: 11 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "rdst"
description = "A flexible, parallel, unstable radix sort. Sort arbitrary types in whatever byte order you wish... or just sort numbers very fast!"
version = "0.20.12"
version = "0.20.14"
authors = ["Nathan Essex <[email protected]>"]
edition = "2021"
license = "Apache-2.0 OR MIT"
Expand Down
6 changes: 5 additions & 1 deletion src/sorts/lsb_sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ impl<'a> Sorter<'a> {
} else {
let mut c_mut = counts.borrow_mut();
c_mut.clear();
cm.count_into(&mut c_mut, &mut meta, bucket, level);
if invert {
cm.count_into(&mut c_mut, &mut meta, tmp_bucket, level);
} else {
cm.count_into(&mut c_mut, &mut meta, bucket, level);
}
drop(c_mut);
next_counts.borrow_mut().clear();

Expand Down
2 changes: 1 addition & 1 deletion src/sorts/mt_lsb_sort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use std::cell::RefCell;
use std::rc::Rc;

pub fn mt_lsb_sort<T>(
src_bucket: &mut [T],
src_bucket: &[T],
dst_bucket: &mut [T],
tile_counts: &[Counts],
tile_size: usize,
Expand Down

0 comments on commit 28170aa

Please sign in to comment.