| ... | @@ -112,12 +112,10 @@ pub fn ArrayHashMap( | ... | @@ -112,12 +112,10 @@ pub fn ArrayHashMap( |
| 112 | return self.unmanaged.clearAndFree(self.allocator); | 112 | return self.unmanaged.clearAndFree(self.allocator); |
| 113 | } | 113 | } |
| 114 | | 114 | |
| 115 | /// Deprecated. Use `items().len`. | | |
| 116 | pub fn count(self: Self) usize { | 115 | pub fn count(self: Self) usize { |
| 117 | return self.items().len; | 116 | return self.unmanaged.count(); |
| 118 | } | 117 | } |
| 119 | | 118 | |
| 120 | /// Deprecated. Iterate using `items`. | | |
| 121 | pub fn iterator(self: *const Self) Iterator { | 119 | pub fn iterator(self: *const Self) Iterator { |
| 122 | return Iterator{ | 120 | return Iterator{ |
| 123 | .hm = self, | 121 | .hm = self, |
| ... | @@ -332,6 +330,10 @@ pub fn ArrayHashMapUnmanaged( | ... | @@ -332,6 +330,10 @@ pub fn ArrayHashMapUnmanaged( |
| 332 | } | 330 | } |
| 333 | } | 331 | } |
| 334 | | 332 | |
| | 333 | pub fn count(self: Self) usize { |
| | 334 | return self.entries.items.len; |
| | 335 | } |
| | 336 | |
| 335 | /// If key exists this function cannot fail. | 337 | /// If key exists this function cannot fail. |
| 336 | /// If there is an existing item with `key`, then the result | 338 | /// If there is an existing item with `key`, then the result |
| 337 | /// `Entry` pointer points to it, and found_existing is true. | 339 | /// `Entry` pointer points to it, and found_existing is true. |