getsentry / rust-sourcemap

A library for rust that implements basic sourcemap handling
Other
224 stars 28 forks source link

Ensure greatest_lower_bound returns lowest match index #60

Closed jridgewell closed 1 year ago

jridgewell commented 1 year ago

When we switched to Rust's binary_search_by_key, we accidentally changed the behavior when a token matches exactly. Before, we were guaranteed to always return the lowest index because we didn't stop iterating when we found a match. Now, we exit as soon as we find a match, which can be any matching based on the size of the slice.

Fixes https://github.com/swc-project/swc/pull/6973

kamilogorek commented 1 year ago

Shall we merge and cut 6.2.2 to unblock https://github.com/swc-project/swc/pull/6973 merge?