mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-05-03 16:22:55 +03:00
02097dff70
setKey used to just call rebuildIndex which allocates a new index and inserts into it all entries. This is the only allocation that setKey needed to do. Instead I propose that setKey sets the key in the entries and then does a remove of the old key from the index and insert of the new key into the index. This eliminates the need for setKey to allocate and makes it infallible To achieve this I extracted a helper function for inserting a single entry into the index. Function for removing one entry from the index already exists. setKey now just calls these two functions.