Skip to content

Commit

Permalink
perf: override AbstractMap#get in ElementNameMap (#4849)
Browse files Browse the repository at this point in the history
  • Loading branch information
SirYwell authored Aug 20, 2022
1 parent 2357619 commit 0d6f397
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/spoon/support/util/internal/ElementNameMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,15 @@ public boolean containsKey(Object key) {
return map.containsKey(key);
}

@Override
public T get(Object key) {
InsertOrderWrapper<T> wrapper = map.get(key);
if (wrapper == null) {
return null;
}
return wrapper.value;
}

/**
* Updates the mapping for a single key from {@code oldKey} to {@code newKey} if present.
*
Expand Down

0 comments on commit 0d6f397

Please sign in to comment.