MCPcopy
hub / github.com/keon/algorithms / _resize

Method _resize

algorithms/data_structures/hash_table.py:171–180  ·  view source on GitHub ↗

Double the table size and rehash all existing entries.

(self)

Source from the content-addressed store, hash-verified

169 self._resize()
170
171 def _resize(self) -> None:
172 """Double the table size and rehash all existing entries."""
173 keys, values = self._keys, self._values
174 self.size *= 2
175 self._len = 0
176 self._keys = [self._empty] * self.size
177 self._values = [self._empty] * self.size
178 for key, value in zip(keys, values, strict=False):
179 if key is not self._empty and key is not self._deleted:
180 self.put(key, value)

Callers 1

putMethod · 0.95

Calls 1

putMethod · 0.95

Tested by

no test coverage detected