Files
serenity/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp
Andreas Kling 37c9b1ce7b LibJS: Store RegExp flags as a bitmask
This avoids having to do O(n) contains() in the various flag accessors.

Yields a ~20% speed-up on the following microbenchmark:

    const re = /foo/dgimsvy;
    for (let i = 0; i < 1_000_000; ++i)
        re.flags;

(cherry picked from commit 257ebea3645ab709be4a984100cc6478b289d0e6)
2024-11-11 10:11:22 -05:00

16 KiB