Skip to content

Commit a16111e

Browse files
committed
Rename PCell.castToCellArray
1 parent 02000a1 commit a16111e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/BuiltinConstructors.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2060,7 +2060,7 @@ public PFunction function(Object cls, PCode code, PDict globals, String name, @S
20602060
@Specialization
20612061
public PFunction function(Object cls, PCode code, PDict globals, @SuppressWarnings("unused") PNone name, @SuppressWarnings("unused") PNone defaultArgs, PTuple closure,
20622062
@Shared("getObjectArrayNode") @Cached GetObjectArrayNode getObjectArrayNode) {
2063-
return factory().createFunction("<lambda>", getTypeName(cls), code, globals, PCell.castToCellArray(getObjectArrayNode.execute(closure)));
2063+
return factory().createFunction("<lambda>", getTypeName(cls), code, globals, PCell.toCellArray(getObjectArrayNode.execute(closure)));
20642064
}
20652065

20662066
@Specialization
@@ -2073,7 +2073,7 @@ public PFunction function(Object cls, PCode code, PDict globals, @SuppressWarnin
20732073
@Specialization
20742074
public PFunction function(Object cls, PCode code, PDict globals, String name, @SuppressWarnings("unused") PNone defaultArgs, PTuple closure,
20752075
@Shared("getObjectArrayNode") @Cached GetObjectArrayNode getObjectArrayNode) {
2076-
return factory().createFunction(name, getTypeName(cls), code, globals, PCell.castToCellArray(getObjectArrayNode.execute(closure)));
2076+
return factory().createFunction(name, getTypeName(cls), code, globals, PCell.toCellArray(getObjectArrayNode.execute(closure)));
20772077
}
20782078

20792079
@Specialization
@@ -2087,7 +2087,7 @@ public PFunction function(Object cls, PCode code, PDict globals, String name, PT
20872087
public PFunction function(Object cls, PCode code, PDict globals, String name, PTuple defaultArgs, PTuple closure,
20882088
@Shared("getObjectArrayNode") @Cached GetObjectArrayNode getObjectArrayNode) {
20892089
// TODO split defaults of positional args from kwDefaults
2090-
return factory().createFunction(name, getTypeName(cls), code, globals, getObjectArrayNode.execute(defaultArgs), null, PCell.castToCellArray(getObjectArrayNode.execute(closure)));
2090+
return factory().createFunction(name, getTypeName(cls), code, globals, getObjectArrayNode.execute(defaultArgs), null, PCell.toCellArray(getObjectArrayNode.execute(closure)));
20912091
}
20922092

20932093
@Fallback

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/PythonCextBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4473,7 +4473,7 @@ static Object doGeneric(VirtualFrame frame, Object codeWrapper, Object globalsWr
44734473
Object closureObj = closureAsPythonObjectNode.execute(closureWrapper);
44744474
if (closureObj != PNone.NO_VALUE) {
44754475
// CPython also just accesses the object as tuple without further checks.
4476-
closure = PCell.castToCellArray(getObjectArrayNode.execute(closureObj));
4476+
closure = PCell.toCellArray(getObjectArrayNode.execute(closureObj));
44774477
}
44784478
Object[] keywordNames = unwrapArray(kwnamesPtr, ptrLib, elementToJavaNode);
44794479
Object[] keywordArguments = unwrapArray(keywordArrayPtr, ptrLib, elementToJavaNode);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cell/PCell.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public PCell(Assumption effectivelyFinalAssumption) {
6464
this.effectivelyFinal = effectivelyFinalAssumption;
6565
}
6666

67-
public static PCell[] castToCellArray(Object[] closure) {
67+
public static PCell[] toCellArray(Object[] closure) {
6868
PCell[] cells = new PCell[closure.length];
6969
PythonUtils.arraycopy(closure, 0, cells, 0, closure.length);
7070
return cells;

0 commit comments

Comments
 (0)