| ... | @@ -21,7 +21,9 @@ pub fn autoHash(hasher: var, key: var) void { | ... | @@ -21,7 +21,9 @@ pub fn autoHash(hasher: var, key: var) void { |
| 21 | builtin.TypeId.EnumLiteral, | 21 | builtin.TypeId.EnumLiteral, |
| 22 | => @compileError("cannot hash this type"), | 22 | => @compileError("cannot hash this type"), |
| 23 | | 23 | |
| 24 | builtin.TypeId.Int => hasher.update(std.mem.asBytes(&key)), | 24 | // Help the optimizer see that hashing an int is easy by inlining! |
| | 25 | // TODO Check if the situation is better after #561 is resolved. |
| | 26 | builtin.TypeId.Int => @inlineCall(hasher.update, std.mem.asBytes(&key)), |
| 25 | | 27 | |
| 26 | builtin.TypeId.Float => |info| autoHash(hasher, @bitCast(@IntType(false, info.bits), key)), | 28 | builtin.TypeId.Float => |info| autoHash(hasher, @bitCast(@IntType(false, info.bits), key)), |
| 27 | | 29 | |