dumpIndex
Function parameters
Parameters
- header:*IndexHeader
- I:type
Type definitions in this namespace
Types
An `ArrayHashMap` with default hash and equal functions.
Functions
- AutoArrayHashMap
- An `ArrayHashMap` with default hash and equal functions.
- AutoArrayHashMapUnmanaged
- An `ArrayHashMapUnmanaged` with default hash and equal functions.
- StringArrayHashMap
- An `ArrayHashMap` with strings as keys.
- StringArrayHashMapUnmanaged
- An `ArrayHashMapUnmanaged` with strings as keys.
- ArrayHashMap
- Deprecated in favor of `ArrayHashMapWithAllocator` (no code changes needed)
- ArrayHashMapWithAllocator
- A hash table of keys and values, each stored sequentially.
- ArrayHashMapUnmanaged
- A hash table of keys and values, each stored sequentially.
Source
Implementation
fn dumpIndex(header: *IndexHeader, comptime I: type) void {
const p = std.debug.print;
p(" index len=0x{x} type={}\n", .{ header.length(), header.capacityIndexType() });
const indexes = header.indexes(I);
if (indexes.len == 0) return;
var is_empty = false;
for (indexes, 0..) |idx, i| {
if (idx.isEmpty()) {
is_empty = true;
} else {
if (is_empty) {
is_empty = false;
p(" ...\n", .{});
}
p(" [0x{x}]: [{}] +{}\n", .{ i, idx.entry_index, idx.distance_from_start_index });
}
}
if (is_empty) {
p(" ...\n", .{});
}
}