Skip to content

Commit 90c05da

Browse files
committed
sq fixes
1 parent 6cdd219 commit 90c05da

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/com/github/_1c_syntax/bsl/languageserver/references/model/SymbolOccurrenceRepository.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,10 @@ public Set<SymbolOccurrence> getAllBySymbol(Symbol symbol) {
6767
*/
6868
public void deleteAll(Set<SymbolOccurrence> symbolOccurrences) {
6969
symbolOccurrences.forEach(symbolOccurrence ->
70-
occurrencesToSymbols.get(symbolOccurrence.symbol()).remove(symbolOccurrence)
70+
occurrencesToSymbols.computeIfPresent(symbolOccurrence.symbol(), (Symbol s, Set<SymbolOccurrence> set) -> {
71+
set.remove(symbolOccurrence);
72+
return set.isEmpty() ? null : set; // null => remove mapping
73+
})
7174
);
7275
}
73-
7476
}

0 commit comments

Comments
 (0)