mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
Adds a new `Bun.indexOfFirstDifference(a, b)` function that returns the index of the first element where `a[i] !== b[i]`, comparing up to `min(a.length, b.length)` elements. Returns the minimum length if the compared prefix is identical. - Uses Google Highway SIMD library for fast byte-level comparison - Converts byte offsets back to element indices for multi-byte TypedArrays - Supports all integer TypedArray types (Uint8, Int8, Uint8Clamped, Uint16, Int16, Uint32, Int32, BigInt64, BigUint64) - Rejects float arrays (Float16/32/64) since NaN !== NaN and NaN has multiple bit representations - Validates same-type requirement and handles detached buffers