| ... | ... | @@ -116,7 +116,7 @@ pub fn hash(hasher: var, key: var, comptime strat: HashStrategy) void { |
| 116 | 116 | // Otherwise, hash every element. |
| 117 | 117 | // TODO remove the copy to an array once field access is done. |
| 118 | 118 | const array: [info.len]info.child = key; |
| 119 | | comptime var i: u32 = 0; |
| 119 | comptime var i = 0; |
| 120 | 120 | inline while (i < info.len) : (i += 1) { |
| 121 | 121 | hash(hasher, array[i], strat); |
| 122 | 122 | } |
| ... | ... | @@ -357,10 +357,13 @@ test "testHash union" { |
| 357 | 357 | test "testHash vector" { |
| 358 | 358 | const a: @Vector(4, u32) = [_]u32{ 1, 2, 3, 4 }; |
| 359 | 359 | const b: @Vector(4, u32) = [_]u32{ 1, 2, 3, 5 }; |
| 360 | | const c: @Vector(4, u31) = [_]u31{ 1, 2, 3, 4 }; |
| 361 | 360 | testing.expect(testHash(a) == testHash(a)); |
| 362 | 361 | testing.expect(testHash(a) != testHash(b)); |
| 363 | | testing.expect(testHash(a) != testHash(c)); |
| 362 | |
| 363 | const c: @Vector(4, u31) = [_]u31{ 1, 2, 3, 4 }; |
| 364 | const d: @Vector(4, u31) = [_]u31{ 1, 2, 3, 5 }; |
| 365 | testing.expect(testHash(c) == testHash(c)); |
| 366 | testing.expect(testHash(c) != testHash(d)); |
| 364 | 367 | } |
| 365 | 368 | |
| 366 | 369 | test "testHash error union" { |