Skip to content

Commit 6faa109

Browse files
committed
create spread for integer hashes to prevent runs
1 parent e212104 commit 6faa109

6 files changed

Lines changed: 4286 additions & 4286 deletions

File tree

BOOTSTRAP/cli.c

Lines changed: 4278 additions & 4278 deletions
Large diffs are not rendered by default.

BOOTSTRAP/monolithic.lsts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ let cmp(l: I64, r: I64): Ord = (
11231123

11241124
let abs(i: I64): I64 = if i<0 then 0_i64 - i else i;
11251125

1126-
let hash(x: I64): U64 = x as U64;
1126+
let hash(x: I64): U64 = (x as U64)*(x as U64);
11271127

11281128
let to-i64(s: CString): I64 = (
11291129
let negative = false;
@@ -2537,7 +2537,7 @@ let cmp(l: U32, r: U32): Ord = (
25372537
else Equal
25382538
);
25392539

2540-
let hash(x: U32): U64 = x as U64;
2540+
let hash(x: U32): U64 = (x as U64)*(x as U64);
25412541

25422542
type opaque alias U64 suffix _u64 = C<"uint64_t">;
25432543

@@ -2639,7 +2639,7 @@ let cmp(l: U8, r: U8): Ord = (
26392639
else Equal
26402640
);
26412641

2642-
let hash(x: U8): U64 = x as U64;
2642+
let hash(x: U8): U64 = (x as U64)*(x as U64);
26432643

26442644
let non-zero(x: U8): Bool = x != 0;
26452645

@@ -2681,7 +2681,7 @@ let cmp(l: USize, r: USize): Ord = (
26812681
else Equal
26822682
);
26832683

2684-
let hash(x: USize): U64 = x as U64;
2684+
let hash(x: USize): U64 = (x as U64)*(x as U64);
26852685

26862686
type Vector<t> implies MustRetain, MustRelease
26872687
= { data: OwnedData<t>[] };

lib/core/i64.lsts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ let cmp(l: I64, r: I64): Ord = (
3737

3838
let abs(i: I64): I64 = if i<0 then 0_i64 - i else i;
3939

40-
let hash(x: I64): U64 = x as U64;
40+
let hash(x: I64): U64 = (x as U64)*(x as U64);
4141

4242
let to-i64(s: CString): I64 = (
4343
let negative = false;

lib/core/u32.lsts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ let cmp(l: U32, r: U32): Ord = (
3737
else Equal
3838
);
3939

40-
let hash(x: U32): U64 = x as U64;
40+
let hash(x: U32): U64 = (x as U64)*(x as U64);

lib/core/u8.lsts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ let cmp(l: U8, r: U8): Ord = (
3737
else Equal
3838
);
3939

40-
let hash(x: U8): U64 = x as U64;
40+
let hash(x: U8): U64 = (x as U64)*(x as U64);
4141

4242
let non-zero(x: U8): Bool = x != 0;

lib/core/usize.lsts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ let cmp(l: USize, r: USize): Ord = (
3737
else Equal
3838
);
3939

40-
let hash(x: USize): U64 = x as U64;
40+
let hash(x: USize): U64 = (x as U64)*(x as U64);

0 commit comments

Comments
 (0)