Skip to content

PubkeyIndexMap: consider using [48]u8 as key #34

@twoeths

Description

@twoeths

from @spiral-ladder comment #28 (comment)

note that this is also used in bun binding so need to assess how it affect performance there

export fn pubkeyIndexMapGet(nbr_ptr: u64, key: [*c]const u8, key_length: c_uint) c_uint {
    if (key_length != PUBKEY_INDEX_MAP_KEY_SIZE) {
        return NOT_FOUND_INDEX;
    }
    const instance_ptr: *PubkeyIndexMapU32 = @ptrFromInt(nbr_ptr);
    const value = instance_ptr.get(key[0..key_length]) orelse return NOT_FOUND_INDEX;
    return value;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions