| ... | ... | @@ -750,12 +750,19 @@ pub fn HashMapUnmanaged( |
| 750 | 750 | fingerprint: FingerPrint = free, |
| 751 | 751 | used: u1 = 0, |
| 752 | 752 | |
| 753 | const slot_free = @bitCast(u8, Metadata{ .fingerprint = free }); |
| 754 | const slot_tombstone = @bitCast(u8, Metadata{ .fingerprint = tombstone }); |
| 755 | |
| 753 | 756 | pub fn isUsed(self: Metadata) bool { |
| 754 | 757 | return self.used == 1; |
| 755 | 758 | } |
| 756 | 759 | |
| 757 | 760 | pub fn isTombstone(self: Metadata) bool { |
| 758 | | return !self.isUsed() and self.fingerprint == tombstone; |
| 761 | return @bitCast(u8, self) == slot_tombstone; |
| 762 | } |
| 763 | |
| 764 | pub fn isFree(self: Metadata) bool { |
| 765 | return @bitCast(u8, self) == slot_free; |
| 759 | 766 | } |
| 760 | 767 | |
| 761 | 768 | pub fn takeFingerprint(hash: Hash) FingerPrint { |
| ... | ... | @@ -1115,7 +1122,7 @@ pub fn HashMapUnmanaged( |
| 1115 | 1122 | var idx = @truncate(usize, hash & mask); |
| 1116 | 1123 | |
| 1117 | 1124 | var metadata = self.metadata.? + idx; |
| 1118 | | while ((metadata[0].isUsed() or metadata[0].isTombstone()) and limit != 0) { |
| 1125 | while (!metadata[0].isFree() and limit != 0) { |
| 1119 | 1126 | if (metadata[0].isUsed() and metadata[0].fingerprint == fingerprint) { |
| 1120 | 1127 | const test_key = &self.keys()[idx]; |
| 1121 | 1128 | // If you get a compile error on this line, it means that your generic eql |
| ... | ... | @@ -1294,7 +1301,7 @@ pub fn HashMapUnmanaged( |
| 1294 | 1301 | |
| 1295 | 1302 | var first_tombstone_idx: usize = self.capacity(); // invalid index |
| 1296 | 1303 | var metadata = self.metadata.? + idx; |
| 1297 | | while ((metadata[0].isUsed() or metadata[0].isTombstone()) and limit != 0) { |
| 1304 | while (!metadata[0].isFree() and limit != 0) { |
| 1298 | 1305 | if (metadata[0].isUsed() and metadata[0].fingerprint == fingerprint) { |
| 1299 | 1306 | const test_key = &self.keys()[idx]; |
| 1300 | 1307 | // If you get a compile error on this line, it means that your generic eql |