only remove from index if no more files have the same comment pt.2

This commit is contained in:
Zlatin Balevsky
2019-10-16 14:23:12 +01:00
parent 942de287c6
commit d4c08f4fe6

View File

@@ -104,12 +104,13 @@ class FileManager {
String comment = sf.getComment()
if (comment != null) {
index.remove(comment)
Set<File> existingComment = commentToFile.get(comment)
if (existingComment != null) {
existingComment.remove(sf.getFile())
if (existingComment.isEmpty())
if (existingComment.isEmpty()) {
commentToFile.remove(comment)
index.remove(comment)
}
}
}