Skip to content

Commit 5bc84dd

Browse files
amatgilkaikalii
authored andcommitted
Tweak tests, use ahasher
1 parent 5f75eaa commit 5bc84dd

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ wasm-bindgen = {workspace = true, optional = true}
180180
web-sys = {version = "0.3.60", optional = true}
181181

182182
# Window dependencies
183+
ahash = "0.8.12"
183184
eframe = {version = "0.29.1", optional = true, features = ["persistence"]}
184185
native-dialog = {version = "0.7.0", optional = true}
185186
rand_xoshiro = "0.7.0"

src/algorithm/dyadic/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ use core::f64;
88
use std::{
99
borrow::Cow,
1010
cmp::Ordering,
11-
hash::{DefaultHasher, Hash, Hasher},
11+
hash::{Hash, Hasher},
1212
iter::{once, repeat_n},
1313
mem::{replace, swap, take},
1414
};
1515

16+
use ahash::AHasher;
1617
use bytemuck::allocation::cast_vec;
1718
use ecow::{eco_vec, EcoVec};
1819
use rand_xoshiro::{
@@ -2113,7 +2114,7 @@ impl Value {
21132114
}
21142115
/// Generate randomly seeded arrays
21152116
pub fn gen(&self, seed: &Self, env: &Uiua) -> UiuaResult<Value> {
2116-
let mut hasher = DefaultHasher::new();
2117+
let mut hasher = AHasher::default();
21172118
seed.hash(&mut hasher);
21182119
let seed = hasher.finish();
21192120
let mut rng = Xoshiro256Plus::seed_from_u64(seed);

src/run_prim.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use std::{
1818
atomic::{self, AtomicUsize},
1919
OnceLock,
2020
},
21-
time::{SystemTime, UNIX_EPOCH},
2221
};
2322

2423
use rand_xoshiro::{

tests/monadic.ua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,5 +269,6 @@ ReprTest! ←^ ˙$"\"_\" repr _" °□⊢
269269
⍤⤙≍ ⟜⍜binary∘ ×π ⇡256
270270

271271
# Rand/Gen
272-
/×♭×⊃≥₀≤₁ gen1000_1000 0
273-
/×♭×⊃≥₀≤₁⍥₁₀₀₀₀⚂
272+
⍤⤙≍1 /×♭×⊃≥₀≤₁ gen1000_1000 0
273+
⍤⤙≍1 /×♭×⊃≥₀≤₁⍥₁₀₀₀₀⚂
274+
⍤⤙≍ 1000_1000 △gen1000_1000 0

0 commit comments

Comments
 (0)