Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def finish(self):
self.__mutid = 0
return Map._new(self.__count, self.__root)
def set(self, key, val):
new_count = self.__count
new_root, added = self.__root.assoc(0, map_hash(key), key, val, 0)
if new_root is self.__root:
assert not added
return self
if added:
new_count += 1
return Map._new(new_count, new_root)