Skip to content

Commit

Permalink
8289658: Avoid redundant LinkedHashMap.get call in TagletManager.addN…
Browse files Browse the repository at this point in the history
…ewSimpleCustomTag

Reviewed-by: attila, prappo
  • Loading branch information
Andrey Turbanov committed Aug 23, 2022
1 parent 84936e9 commit b4e1aa8
Showing 1 changed file with 3 additions and 4 deletions.
Expand Up @@ -311,16 +311,15 @@ public void addNewSimpleCustomTag(String tagName, String header, String location
if (tagName == null || locations == null) {
return;
}
Taglet tag = allTaglets.get(tagName);
// remove + put in both branches below move the tag to the back of the map's ordering
Taglet tag = allTaglets.remove(tagName);
if (tag == null || header != null) {
allTaglets.remove(tagName);
allTaglets.put(tagName, new SimpleTaglet(tagName, header, locations));
if (Utils.toLowerCase(locations).indexOf('x') == -1) {
checkTagName(tagName);
}
} else {
//Move to back
allTaglets.remove(tagName);
// Move existing tag to the back
allTaglets.put(tagName, tag);
}
}
Expand Down

1 comment on commit b4e1aa8

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.