pub fn clearRetainingCapacity(m: *Map) void m: *Map370
371
372
373
374
375
376
377 pub fn clearRetainingCapacity(m: *Map) void {
const gpa = m.allocator;
for (m.array_hash_map.keys(), m.array_hash_map.values()) |k, v| {
gpa.free(k);
gpa.free(v);
}
m.array_hash_map.clearRetainingCapacity();
}
Set the length to zero, freeing all key and value memory, not freeing the allocation for the entries.