Skip to content

Commit 7abc7b9

Browse files
committed
use atomic access
1 parent 05fbd01 commit 7abc7b9

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/parser/PythonParserImpl.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,7 @@ private static ParserRuleContext preParseWithAntlr(PythonCore core, Source sourc
7474
Python3Parser parser = getPython3Parser(fromString);
7575
ParserRuleContext input;
7676
if (!core.isInitialized()) {
77-
input = cachedParseTrees.get(fileDirAndName);
78-
if (input == null) {
79-
input = parser.file_input();
80-
cachedParseTrees.put(fileDirAndName, input);
81-
}
77+
input = cachedParseTrees.computeIfAbsent(fileDirAndName, (key) -> parser.file_input());
8278
} else {
8379
try {
8480
if (source.isInteractive()) {

0 commit comments

Comments
 (0)