mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-06 08:23:19 +08:00
String.prototype.localeCompare keeps its results and gets fast paths for the common cases. Byte-equal strings compare equal at once. ASCII strings compare their primary weights in one pass from a per-thread table and read the secondary and tertiary weights only when every primary is equal. Latin text whose marks carry no primary weight compares primaries lazily, decoding only until the first difference. Other text, and every tie at the primary level, uses the existing element lists, which no longer zero their inline buffers or check capacity per element. The backend lends both strings to the call instead of retaining them.