| ... | @@ -504,25 +504,25 @@ pub fn EnumMap(comptime E: type, comptime V: type) type { | ... | @@ -504,25 +504,25 @@ pub fn EnumMap(comptime E: type, comptime V: type) type { |
| 504 | } | 504 | } |
| 505 | | 505 | |
| 506 | /// The number of items in the map. | 506 | /// The number of items in the map. |
| 507 | pub fn count(self: Self) usize { | 507 | pub fn count(self: *const Self) usize { |
| 508 | return self.bits.count(); | 508 | return self.bits.count(); |
| 509 | } | 509 | } |
| 510 | | 510 | |
| 511 | /// Checks if the map contains an item. | 511 | /// Checks if the map contains an item. |
| 512 | pub fn contains(self: Self, key: Key) bool { | 512 | pub fn contains(self: *const Self, key: Key) bool { |
| 513 | return self.bits.isSet(Indexer.indexOf(key)); | 513 | return self.bits.isSet(Indexer.indexOf(key)); |
| 514 | } | 514 | } |
| 515 | | 515 | |
| 516 | /// Gets the value associated with a key. | 516 | /// Gets the value associated with a key. |
| 517 | /// If the key is not in the map, returns null. | 517 | /// If the key is not in the map, returns null. |
| 518 | pub fn get(self: Self, key: Key) ?Value { | 518 | pub fn get(self: *const Self, key: Key) ?Value { |
| 519 | const index = Indexer.indexOf(key); | 519 | const index = Indexer.indexOf(key); |
| 520 | return if (self.bits.isSet(index)) self.values[index] else null; | 520 | return if (self.bits.isSet(index)) self.values[index] else null; |
| 521 | } | 521 | } |
| 522 | | 522 | |
| 523 | /// Gets the value associated with a key, which must | 523 | /// Gets the value associated with a key, which must |
| 524 | /// exist in the map. | 524 | /// exist in the map. |
| 525 | pub fn getAssertContains(self: Self, key: Key) Value { | 525 | pub fn getAssertContains(self: *const Self, key: Key) Value { |
| 526 | const index = Indexer.indexOf(key); | 526 | const index = Indexer.indexOf(key); |
| 527 | assert(self.bits.isSet(index)); | 527 | assert(self.bits.isSet(index)); |
| 528 | return self.values[index]; | 528 | return self.values[index]; |