Skip to content

Commit 5bbc33a

Browse files
author
Vladimir Kotal
committed
use merge()
1 parent 062e30c commit 5bbc33a

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

opengrok-indexer/src/main/java/org/opengrok/indexer/history/GitRepository.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -606,12 +606,7 @@ private void rebuildTagList(File directory) {
606606
String tagName = ref.getName().replace("refs/tags/", "");
607607
String existingTags;
608608
RevCommit commit = getCommit(repository, ref);
609-
if ((existingTags = commit2Tags.get(commit)) != null) {
610-
existingTags = existingTags + TAGS_SEPARATOR + tagName;
611-
commit2Tags.put(commit, existingTags);
612-
} else {
613-
commit2Tags.put(commit, tagName);
614-
}
609+
commit2Tags.merge(commit, tagName, (oldValue, newValue) -> oldValue + TAGS_SEPARATOR + newValue);
615610
}
616611

617612
for (Map.Entry<RevCommit, String> entry : commit2Tags.entrySet()) {

0 commit comments

Comments
 (0)