Skip to content

Commit f628a60

Browse files
author
Michal Medvecky
committed
lambda repr/str refactoring
1 parent 0bb568f commit f628a60

File tree

1 file changed

+3
-8
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/compiler/bytecode_dsl

1 file changed

+3
-8
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/compiler/bytecode_dsl/RootNodeCompiler.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ public final class RootNodeCompiler implements BaseBytecodeDSLVisitor<BytecodeDS
191191
*/
192192
private final String privateName;
193193
private final RootNodeCompiler parent;
194-
private final boolean isRoot;
195194
private String qualName;
196195

197196
// Immutable after construction
@@ -221,11 +220,6 @@ public RootNodeCompiler(BytecodeDSLCompilerContext ctx, RootNodeCompiler parent,
221220
this.startNode = rootNode;
222221
this.scope = ctx.scopeEnvironment.lookupScope(scopeKey);
223222
this.scopeType = getScopeType(scope, scopeKey);
224-
if (parent == null) {
225-
this.isRoot = true;
226-
} else {
227-
this.isRoot = false;
228-
}
229223
this.parent = parent;
230224
if (privateName != null) {
231225
this.privateName = privateName;
@@ -333,10 +327,11 @@ private static TruffleString[] orderedTruffleStringArray(HashMap<String, Integer
333327

334328
private String getNewScopeQualName(String name, CompilationScope scopeType) {
335329
RootNodeCompiler parent = this.parent;
336-
if (parent != null && !parent.isRoot) {
330+
if (parent != null && parent.parent != null) {
337331
if (parent.scopeType == TypeParams && parent.parent != null && parent.parent.parent != null) {
338332
parent = parent.parent;
339-
if (parent.parent.parent != null && parent.parent.parent.parent == null) {
333+
if (parent.parent != null && parent.parent.parent == null) {
334+
// if there are exactly two parents/ancestros, then return the name
340335
return name;
341336
}
342337
}

0 commit comments

Comments
 (0)