mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Remove unnecessary synchronized in SimpleStringPersistentEnumerator.
GitOrigin-RevId: 532daaacaa646558ea8ebea7284677610f3355e8
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cdbeda1c0a
commit
15b09ff212
@@ -24,7 +24,7 @@ import java.util.List;
|
||||
* </ul>
|
||||
*/
|
||||
@ApiStatus.Internal
|
||||
public class SimpleStringPersistentEnumerator {
|
||||
public final class SimpleStringPersistentEnumerator {
|
||||
public static final int MAX_NUMBER_OF_INDICES = Short.MAX_VALUE;
|
||||
|
||||
@NotNull
|
||||
@@ -81,19 +81,15 @@ public class SimpleStringPersistentEnumerator {
|
||||
nameToIdRegistry.put(name, i + 1);
|
||||
}
|
||||
|
||||
synchronized (myState) {
|
||||
myState.ensureCapacity(nameToIdRegistry.size());
|
||||
nameToIdRegistry.forEachEntry((name, index) -> {
|
||||
myState.put(name, index);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
myState.ensureCapacity(nameToIdRegistry.size());
|
||||
nameToIdRegistry.forEachEntry((name, index) -> {
|
||||
myState.put(name, index);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
catch (IOException e) {
|
||||
synchronized (myState) {
|
||||
myState.clear();
|
||||
writeStorageToDisk();
|
||||
}
|
||||
myState.clear();
|
||||
writeStorageToDisk();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user