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

pull/24/head
Zlatin Balevsky 2019-10-16 14:23:12 +01:00
parent 942de287c6
commit d4c08f4fe6
1 changed files with 3 additions and 2 deletions

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)
}
}
}