perf(es/minifier): Optimize usage of IndexSet (#5814)

This commit is contained in:
Donny/강동윤 2022-09-11 02:11:41 +09:00 committed by GitHub
parent b2b7b23460
commit 704ea3d48d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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