pub fn orderedRemove(self: *Map, key: []const u8) bool self: *Mapkey: []const u8322
323
324
325
326
327
328
329 pub fn orderedRemove(self: *Map, key: []const u8) bool {
assert(validateKeyForFetch(key));
const kv = self.array_hash_map.fetchOrderedRemove(key) orelse return false;
const gpa = self.allocator;
gpa.free(kv.key);
gpa.free(kv.value);
return true;
}
If there is an entry with a matching key, it is deleted from the map. The entry is removed from the underlying array by shifting all elements forward, thereby maintaining the current ordering.
Returns true if an entry was removed, false otherwise.
This invalidates the value returned by get() for this key. On Windows, asserts that
keyis valid WTF-8.