8289658: Avoid redundant LinkedHashMap.get call in TagletManager.addNewSimpleCustomTag
Reviewed-by: attila, prappo
This commit is contained in:
parent
84936e9278
commit
b4e1aa87e3
@ -311,16 +311,15 @@ public class TagletManager {
|
|||||||
if (tagName == null || locations == null) {
|
if (tagName == null || locations == null) {
|
||||||
return;
|
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) {
|
if (tag == null || header != null) {
|
||||||
allTaglets.remove(tagName);
|
|
||||||
allTaglets.put(tagName, new SimpleTaglet(tagName, header, locations));
|
allTaglets.put(tagName, new SimpleTaglet(tagName, header, locations));
|
||||||
if (Utils.toLowerCase(locations).indexOf('x') == -1) {
|
if (Utils.toLowerCase(locations).indexOf('x') == -1) {
|
||||||
checkTagName(tagName);
|
checkTagName(tagName);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//Move to back
|
// Move existing tag to the back
|
||||||
allTaglets.remove(tagName);
|
|
||||||
allTaglets.put(tagName, tag);
|
allTaglets.put(tagName, tag);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user