Version 1.3.3
What's Changed
Changed
List.buildValue()uses apushloop instead ofmap/filter: Eliminates the intermediate(T | undefined)[]allocation thatmap()produced beforefilter()could removeundefinedentries. Now builds the result in a single pre-allocated pass.List.sort()uses an imperative loop: Replaceskeys.map(key => [key, signals.get(key)?.get()]).sort(...).map(([key]) => key)with a singleentriesbuild loop and a separatenewOrderaccumulation loop, removing two intermediate array allocations.List.splice()andList.replace()use boolean flags for change detection: ReplacesObject.keys(changes.change).length(iterates all keys to count) with an early-exitfor...inloop that sets a flag on the first key found.List.add()drops redundantkeys.includes(key)guard: The precedingsignals.has(key)check already throwsDuplicateKeyErrorfor duplicate keys;keys.includes(key)was unreachable dead code.diffArrayssplit intodiffPositionalfor non-content-based keys: Positional-key lists now take a dedicated fast path (diffPositional) that walks both arrays in a singleO(n)pass with noMaporSetallocation. Content-based diffing retains theMap/Setapproach for key-stability tracking.syncKeysinderiveCollectionreducesSetallocations: Previously constructed twoSets (new Set(keys)andnew Set(nextKeys)). Now constructs onlynextSet = new Set(nextKeys)for deletion detection and uses the existingsignalsMapdirectly (signals.has(key)) to decide whether a key needs to be added.Store.buildValue()andStore[Symbol.iterator]iterateMapentries directly:buildValuereplacessignals.forEach((signal, key) => ...)withfor (const [key, signal] of signals). The iterator replacesArray.from(signals.keys())and a secondarysignals.get(key)lookup with a singlefor...ofoversignalsentries, eliminating an intermediate array allocation.Slottype assertion cleanup: Removedas anycasts inisSignalOrDescriptorandcreateSlot.set; usedreturn void delegated.set(next)in the Slot-to-Slot delegation path to avoid implicitly returning the inner call's result.
New Contributors
- @enesgules made their first contribution in #46
Full Changelog: v1.3.2...v1.3.3