mirror of
https://github.com/swc-project/swc.git
synced 2024-11-28 11:13:43 +03:00
perf(es/minifier): Optimize usage of IndexSet
(#5814)
This commit is contained in:
parent
b2b7b23460
commit
704ea3d48d
@ -111,7 +111,7 @@ struct Data {
|
||||
|
||||
impl Data {
|
||||
fn node(&mut self, id: &Id) -> usize {
|
||||
self.graph_ix.get_full(id).map(|v| v.0).unwrap_or_else(|| {
|
||||
self.graph_ix.get_index_of(id).unwrap_or_else(|| {
|
||||
let ix = self.graph_ix.len();
|
||||
self.graph_ix.insert_full(id.clone());
|
||||
ix
|
||||
|
Loading…
Reference in New Issue
Block a user