From 0d6f3971003d27227f69e4cebd89f27fd6ce94a7 Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Sat, 20 Aug 2022 11:02:54 +0200 Subject: [PATCH] perf: override AbstractMap#get in ElementNameMap (#4849) --- .../java/spoon/support/util/internal/ElementNameMap.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/spoon/support/util/internal/ElementNameMap.java b/src/main/java/spoon/support/util/internal/ElementNameMap.java index 04bd678caea..169160f9ee1 100644 --- a/src/main/java/spoon/support/util/internal/ElementNameMap.java +++ b/src/main/java/spoon/support/util/internal/ElementNameMap.java @@ -159,6 +159,15 @@ public boolean containsKey(Object key) { return map.containsKey(key); } + @Override + public T get(Object key) { + InsertOrderWrapper 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. *