0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib/std
Prokop Randáček 02097dff70 setKey shouldn't recompute the entire index
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.
History 2026-05-02 20:15:10 +02:00
..
Build std: rename bit_set variants and deprecate the managed one. 2026-04-27 16:46:26 +02:00
builtin Add RISC-V ABI register alias names for inline asm clobbers 2026-04-08 14:37:48 +02:00
c std.c: Fix serenity's futex() declaration 2026-04-16 23:48:05 +01:00
compress remove uses of array multiplication 2026-04-30 08:57:51 +01:00
crypto compiler: remove array multiplication from the language 2026-04-30 09:03:58 +01:00
debug remove uses of array multiplication 2026-04-30 08:57:51 +01:00
dwarf fix compiler ftbfs from std.macho and std.dwarf changes 2025-09-30 13:44:51 +01:00
fmt remove uses of array multiplication 2026-04-30 08:57:51 +01:00
fs remove uses of array multiplication 2026-04-30 08:57:51 +01:00
hash remove uses of array multiplication 2026-04-30 08:57:51 +01:00
heap remove deprecated managed MemoryPool versions (#31483) 2026-05-01 05:27:45 +02:00
http std.http.test: update issue link for powerpc64 LLVM crash 2026-04-26 21:46:14 +02:00
Io remove uses of array multiplication 2026-04-30 08:57:51 +01:00
json remove uses of array multiplication 2026-04-30 08:57:51 +01:00
math remove uses of array multiplication 2026-04-30 08:57:51 +01:00
mem std: fix sentinel handling in Allocator interface 2026-03-25 10:50:24 +01:00
meta all: replace all @Type usages 2025-11-22 22:42:38 +00:00
os remove uses of array multiplication 2026-04-30 08:57:51 +01:00
posix remove uses of array multiplication 2026-04-30 08:57:51 +01:00
process Improve debug I/O color detection/handling for WASI and Emscripten 2026-04-11 12:25:22 -07:00
Random remove uses of array multiplication 2026-04-30 08:57:51 +01:00
sort std.sort.pdq: fix out-of-bounds access in partialInsertionSort (#25253) 2025-09-17 19:54:15 -07:00
tar remove uses of array multiplication 2026-04-30 08:57:51 +01:00
Target std.Target: update CPU and feature data to LLVM 22 2026-04-25 21:54:47 +02:00
testing Removes dead code, updates some tests, fixes typos in comments, formats 2026-04-12 04:01:30 -07:00
time removed reduntant @as() from switch in getDaysInMonth 2026-02-05 21:58:35 +01:00
tz Support legacy TZ format, expose header struct to a potential writer 2022-01-01 12:47:08 +00:00
unicode remove uses of array multiplication 2026-04-30 08:57:51 +01:00
valgrind Remove numerous things deprecated during the 0.14 release cycle 2025-07-11 08:17:43 +02:00
zig std:ArrayList: Merge getLastOrNull into getLast (#32008) 2026-05-02 02:26:15 +02:00
zon std: re-enable some tests on s390x 2026-04-26 21:22:31 +02:00
array_hash_map.zig setKey shouldn't recompute the entire index 2026-05-02 20:15:10 +02:00
array_list.zig std:ArrayList: Merge getLastOrNull into getLast (#32008) 2026-05-02 02:26:15 +02:00
ascii.zig feat(std.ascii): add boundedOrderIgnoreCaseZ 2026-01-17 21:42:38 +01:00
atomic.zig Merge pull request 'std.heap.ArenaAllocator: add fuzz test + some optimizations' (#31407) from justusk/zig:fuzz-arena into master 2026-03-11 03:00:07 +01:00
base64.zig remove uses of array multiplication 2026-04-30 08:57:51 +01:00
bit_set.zig remove uses of array multiplication 2026-04-30 08:57:51 +01:00
BitStack.zig std.ArrayList: make unmanaged the default 2025-08-11 15:52:49 -07:00
buf_map.zig lib: correct unnecessary uses of 'var' 2023-11-19 09:55:07 +00:00
buf_set.zig Change many test blocks to doctests/decltests 2024-02-26 15:18:31 -08:00
Build.zig delete @cImport from the language 2026-04-15 17:43:53 -07:00
builtin.zig feat: init eZ80 arch via CBE 2026-04-16 19:21:16 +02:00
c.zig remove uses of array multiplication 2026-04-30 08:57:51 +01:00
coff.zig std: replace usages of std.mem.indexOf with std.mem.find 2025-12-05 14:31:27 +01:00
compress.zig std.compress: rework flate to new I/O API 2025-07-31 22:10:11 -07:00
crypto.zig remove uses of array multiplication 2026-04-30 08:57:51 +01:00
debug.zig remove uses of array multiplication 2026-04-30 08:57:51 +01:00
deque.zig std:ArrayList: Merge getLastOrNull into getLast (#32008) 2026-05-02 02:26:15 +02:00
DoublyLinkedList.zig *LinkedList.remove() assumes node is in the list 2025-10-25 21:10:02 -07:00
dwarf.zig Dwarf: cleanup emitted debug info 2024-08-22 08:44:08 +02:00
dynamic_library.zig std: move GetFinalPathNameByHandle to Io.Threaded 2026-02-04 16:27:13 -08:00
elf.zig remove uses of array multiplication 2026-04-30 08:57:51 +01:00
enums.zig remove uses of array multiplication 2026-04-30 08:57:51 +01:00
fmt.zig remove uses of array multiplication 2026-04-30 08:57:51 +01:00
fs.zig std: find a better home for the "preopens" concept 2026-01-08 05:06:31 +01:00
gpu.zig remove std.gpu.(binding|location) 2025-12-22 10:00:35 -08:00
hash.zig all: replace all @Type usages 2025-11-22 22:42:38 +00:00
hash_map.zig compiler,std: various little fixes 2026-03-10 10:26:14 +00:00
heap.zig remove deprecated managed MemoryPool versions (#31483) 2026-05-01 05:27:45 +02:00
http.zig remove uses of array multiplication 2026-04-30 08:57:51 +01:00
Io.zig io: make toClock compile 2026-04-19 16:58:12 -07:00
json.zig std.Io: delete GenericReader 2025-08-29 17:14:26 -07:00
leb128.zig std.Io: delete GenericReader 2025-08-29 17:14:26 -07:00
log.zig std.Threaded: replace console kernel32 functions with ntdll 2026-02-05 07:41:25 -05:00
macho.zig std: update for language changes 2026-03-10 10:38:50 +00:00
math.zig lib,test: remove uses of i0 2026-04-30 08:57:51 +01:00
mem.zig remove uses of array multiplication 2026-04-30 08:57:51 +01:00
meta.zig lib,test: remove uses of i0 2026-04-30 08:57:51 +01:00
multi_array_list.zig std.MultiArrayList: add a swap method 2026-05-01 06:31:11 +02:00
os.zig std.os: add APIs to determine whether Zig std requires libc for a target 2026-04-17 12:07:57 +02:00
pdb.zig Removes dead code, updates some tests, fixes typos in comments, formats 2026-04-12 04:01:30 -07:00
pie.zig std.pie: add missing clobbers on alpha and sparc 2025-11-14 12:19:38 +01:00
posix.zig Allow the user to override unexpected error trace 2026-04-13 19:58:01 +02:00
priority_dequeue.zig priority queue and dequeue: use *const Self in read-only methods and fix deinit (#31712) 2026-04-03 22:20:46 +02:00
priority_queue.zig priority queue and dequeue: use *const Self in read-only methods and fix deinit (#31712) 2026-04-03 22:20:46 +02:00
process.zig Prefer <err> => |e| return e over <err> => return <err> 2026-04-20 18:03:14 -07:00
Progress.zig Revert "std.Progress: use cmpxchgStrong instead of cmpxchgWeak for locking/unlocking IPC" 2026-03-21 14:04:24 +01:00
Random.zig feat(std.Random): add a linear congruent generator 2026-01-14 12:48:09 +01:00
SemanticVersion.zig Prefer <err> => |e| return e over <err> => return <err> 2026-04-20 18:03:14 -07:00
simd.zig std: re-enable a bunch of tests that now pass 2026-04-25 21:54:48 +02:00
SinglyLinkedList.zig SinglyLinkedList.remove docs: Assumes -> asserts 2025-10-25 21:28:54 -07:00
sort.zig std.sort: clarify description of equalRange 2026-04-16 19:42:00 +02:00
start.zig DllMain symbols: use ptrCast to allow using non-std pointer type 2026-05-02 02:44:26 -07:00
static_string_map.zig std.static_string_map: Cast length of input for runtime initialization 2024-06-20 23:22:39 +00:00
std.zig std: alias lang to builtin 2026-05-02 11:29:27 +02:00
tar.zig remove uses of array multiplication 2026-04-30 08:57:51 +01:00
Target.zig drop support for powerpc64-linux-gnu 2026-04-26 19:24:46 +02:00
testing.zig std: rename bit_set variants and deprecate the managed one. 2026-04-27 16:46:26 +02:00
Thread.zig remove uses of array multiplication 2026-04-30 08:57:51 +01:00
time.zig std: finish moving time to Io interface 2026-02-02 23:02:31 -08:00
treap.zig std.ArrayList: make unmanaged the default 2025-08-11 15:52:49 -07:00
tz.zig std.tz: fix redundant endian handling 2025-08-28 18:30:57 -07:00
unicode.zig remove uses of array multiplication 2026-04-30 08:57:51 +01:00
Uri.zig std.Uri: reject invalid URI schemes according to RFC3986 2026-03-23 05:22:46 +01:00
valgrind.zig remove condition codes 2025-07-16 10:27:39 -07:00
wasm.zig wasm linker: implement @tagName for sparse enums 2025-01-15 15:11:36 -08:00
zig.zig compiler: remove array multiplication from the language 2026-04-30 09:03:58 +01:00
zip.zig Prefer <err> => |e| return e over <err> => return <err> 2026-04-20 18:03:14 -07:00
zon.zig zon: Add anonymous struct literal in the example 2025-08-15 23:35:16 +02:00