try radsort
| -rw-r--r-- | Cargo.lock | 7 | ||||
| -rw-r--r-- | Cargo.toml | 1 | ||||
| -rw-r--r-- | src/lib.rs | 4 |
3 files changed, 10 insertions, 2 deletions
@@ -38,6 +38,7 @@ dependencies = [ "aoc-runner", "aoc-runner-derive", "memchr", + "radsort", "rustc-hash", ] @@ -90,6 +91,12 @@ dependencies = [ ] [[package]] +name = "radsort" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "019b4b213425016d7d84a153c4c73afb0946fbb4840e4eece7ba8848b9d6da22" + +[[package]] name = "rustc-hash" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -7,4 +7,5 @@ edition = "2021" aoc-runner = "0.1.0" aoc-runner-derive = "0.1.0" memchr = "2.7.4" +radsort = "0.1.1" rustc-hash = "2.1.0" @@ -42,8 +42,8 @@ pub mod day1 { *b.get_unchecked_mut(i) = y; }); - a.sort_unstable(); - b.sort_unstable(); + radsort::sort(&mut a); + radsort::sort(&mut b); a.iter() .copied() .zip(b) |