Skip to content

Commit 703a824

Browse files
committed
Tweak tests, use ahasher
1 parent dca18e4 commit 703a824

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 @@ eframe = {version = "0.29.1", optional = true, features = ["persistence"]}
180180
native-dialog = {version = "0.7.0", optional = true}
181181
rmp-serde = {version = "1.3.0", optional = true}
182182
rand_xoshiro = "0.7.0"
183+
ahash = "0.8.12"
183184

184185
[features]
185186
apng = ["dep:png"]

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::{
@@ -2111,7 +2112,7 @@ impl Value {
21112112
}
21122113
/// Generate randomly seeded arrays
21132114
pub fn gen(&self, seed: &Self, env: &Uiua) -> UiuaResult<Value> {
2114-
let mut hasher = DefaultHasher::new();
2115+
let mut hasher = AHasher::default();
21152116
seed.hash(&mut hasher);
21162117
let seed = hasher.finish();
21172118
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
@@ -259,5 +259,6 @@ repr[{[[1 2][2 3]][3 4]}{[[1 2][2 3]]□{[[1 2][2 3]]□□[3 4]}}]
259259
⍤⤙≍ ⟜⍜binary∘ ×π ⇡256
260260

261261
# Rand/Gen
262-
/×♭×⊃≥₀≤₁ gen1000_1000 0
263-
/×♭×⊃≥₀≤₁⍥₁₀₀₀₀⚂
262+
⍤⤙≍1 /×♭×⊃≥₀≤₁ gen1000_1000 0
263+
⍤⤙≍1 /×♭×⊃≥₀≤₁⍥₁₀₀₀₀⚂
264+
⍤⤙≍ 1000_1000 △gen1000_1000 0

0 commit comments

Comments
 (0)