Skip to content

Commit ce9df96

Browse files
committed
[GR-14367] Temporarily remove assertions.
PullRequest: graalpython/429
2 parents 9f6f49c + 77c2554 commit ce9df96

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/function/FunctionDefinitionNode.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
*/
2626
package com.oracle.graal.python.nodes.function;
2727

28-
import java.util.Arrays;
29-
3028
import com.oracle.graal.python.builtins.objects.cell.PCell;
3129
import com.oracle.graal.python.builtins.objects.function.PArguments;
3230
import com.oracle.graal.python.builtins.objects.function.PFunction;
@@ -60,12 +58,21 @@ public FunctionDefinitionNode(String functionName, String enclosingClassName, Ex
6058
this.enclosingClassName = enclosingClassName;
6159
this.doc = doc;
6260
this.callTarget = callTarget;
63-
assert defaults == null || Arrays.stream(defaults).noneMatch(x -> x == null);
61+
assert defaults == null || noNullElements(defaults);
6462
this.defaults = defaults;
65-
assert kwDefaults == null || Arrays.stream(kwDefaults).noneMatch(x -> x == null);
63+
assert kwDefaults == null || noNullElements(kwDefaults);
6664
this.kwDefaults = kwDefaults;
6765
}
6866

67+
private static boolean noNullElements(Object[] array) {
68+
for (Object element : array) {
69+
if (element == null) {
70+
return false;
71+
}
72+
}
73+
return true;
74+
}
75+
6976
@Override
7077
public Object execute(VirtualFrame frame) {
7178
Object[] defaultValues = computeDefaultValues(frame);

0 commit comments

Comments
 (0)