next.js
4638ab18 - Turbopack: Avoid clone when sorting by module file path (#95079)

Commit
28 days ago
Turbopack: Avoid clone when sorting by module file path (#95079) Minor nit: In the worst-case (module id can be an `RcStr` or a u64), this eliminates two `RcStr` clones+drops per iteration of the sort algorithm. The code is cleaner with `sort_by_key`, but `sort_by_key` introduces an artificial lifetime issue that `sort_by` avoids. This is a long-standing and widely documented language issue: https://github.com/rust-lang/rust/issues/34162
Author
bgw bgw
Parents
Loading