Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Private Function

constrainIndex

Private Function
std.array_hash_map.IndexHeader.constrainIndex
fn constrainIndex(header: IndexHeader, i: usize) usize

Map from an incrementing index to an index slot in the attached arrays.

Params

File

array_hash_map.zig:1649
1649
1650
1651
1652
1653
    fn constrainIndex(header: IndexHeader, i: usize) usize {
        // This is an optimization for modulo of power of two integers;
        // it requires `indexes_len` to always be a power of two.
        return @as(usize, @intCast(i & header.mask()));
    }