Skip to content

Commit 3acbb73

Browse files
committed
Introduce constant for kw defaults
1 parent 4903057 commit 3acbb73

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/hpy/HPyExternalFunctionNodes.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,9 @@ public abstract class HPyExternalFunctionNodes {
146146
private static final String KW_CALLABLE = "$callable";
147147
private static final String KW_CLOSURE = "$closure";
148148
private static final String KW_CONTEXT = "$context";
149-
private static final String[] KEYWORDS_HIDDEN_CALLABLE = new String[]{KW_CALLABLE, KW_CONTEXT};
150-
private static final String[] KEYWORDS_HIDDEN_CALLABLE_AND_CLOSURE = new String[]{KW_CALLABLE, KW_CONTEXT, KW_CLOSURE};
149+
private static final String[] KEYWORDS_HIDDEN_CALLABLE = {KW_CALLABLE, KW_CONTEXT};
150+
private static final String[] KEYWORDS_HIDDEN_CALLABLE_AND_CLOSURE = {KW_CALLABLE, KW_CONTEXT, KW_CLOSURE};
151+
private static final Object[] KW_DEFAULTS = {PNone.NO_VALUE};
151152

152153
private static PKeyword[] createKwDefaults(Object callable, GraalHPyContext context) {
153154
return new PKeyword[]{new PKeyword(KW_CALLABLE, callable), new PKeyword(KW_CONTEXT, context)};
@@ -183,7 +184,7 @@ static PBuiltinFunction createWrapperFunction(PythonLanguage language, GraalHPyC
183184
if (signature == HPyFuncSignature.TERNARYFUNC) {
184185
// the third argument is optional
185186
// so it has a default value (this implicitly is 'None')
186-
defaults = new Object[]{PNone.NO_VALUE};
187+
defaults = KW_DEFAULTS;
187188
} else {
188189
defaults = PythonUtils.EMPTY_OBJECT_ARRAY;
189190
}

0 commit comments

Comments
 (0)