mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
nextAll/prevAll walks the entire DOM, basically. This code only walks the DOM until we find a new .message_row. This speeds up the average time of a call to this function from about 6.38ms to 0.678ms, in my benchmarking. Admittedly, the whole outer loop here could still use some optimization, if we want to; do we really need to call this 1000 times? (imported from commit 852e2f660a16f8cfd7be35d3271aedb1ac481663)
1.0 KiB
1.0 KiB