From d4c08f4fe6d840100b5f620b456da410bfbc20df Mon Sep 17 00:00:00 2001 From: Zlatin Balevsky Date: Wed, 16 Oct 2019 14:23:12 +0100 Subject: [PATCH] only remove from index if no more files have the same comment pt.2 --- .../src/main/groovy/com/muwire/core/files/FileManager.groovy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/groovy/com/muwire/core/files/FileManager.groovy b/core/src/main/groovy/com/muwire/core/files/FileManager.groovy index 0c1297ef..74f75d74 100644 --- a/core/src/main/groovy/com/muwire/core/files/FileManager.groovy +++ b/core/src/main/groovy/com/muwire/core/files/FileManager.groovy @@ -104,12 +104,13 @@ class FileManager { String comment = sf.getComment() if (comment != null) { - index.remove(comment) Set existingComment = commentToFile.get(comment) if (existingComment != null) { existingComment.remove(sf.getFile()) - if (existingComment.isEmpty()) + if (existingComment.isEmpty()) { commentToFile.remove(comment) + index.remove(comment) + } } }