mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 14:23:28 +07:00
[textmate] IDEA-345045 TextMate: a lot of Lambda instances spawned from ShellVariablesRegistryImpl
GitOrigin-RevId: 5617307ac62718f149e475e7d9ba58e925e084b3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
814f5a2b08
commit
7b8f9beb38
@@ -13,9 +13,13 @@ import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.function.Function;
|
||||
|
||||
public final class ShellVariablesRegistryImpl implements ShellVariablesRegistry {
|
||||
|
||||
private final Function<String, Collection<TextMateShellVariable>>
|
||||
ADD_VARIABLE_FACTORY = key -> Collections.synchronizedList(new CopyOnWriteArrayList<>());
|
||||
|
||||
@NotNull private final Map<String, Collection<TextMateShellVariable>> myVariables = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
@@ -38,7 +42,7 @@ public final class ShellVariablesRegistryImpl implements ShellVariablesRegistry
|
||||
|
||||
public void addVariable(@NotNull TextMateShellVariable variable) {
|
||||
if (!variable.name.isEmpty()) {
|
||||
myVariables.computeIfAbsent(variable.name, key -> Collections.synchronizedList(new CopyOnWriteArrayList<>())).add(variable);
|
||||
myVariables.computeIfAbsent(variable.name, ADD_VARIABLE_FACTORY).add(variable);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user