Skip to content

Commit 2cd2ad7

Browse files
committed
Simplify further as we currently do not need the list of kwarg names
* This commit can easily be reverted once we need them.
1 parent 6e7eff2 commit 2cd2ad7

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/main/java/org/truffleruby/parser/BodyTranslator.java

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3129,30 +3129,23 @@ private static ArgumentsDescriptor getKeywordArgumentsDescriptor(RubyLanguage la
31293129
return EmptyArgumentsDescriptor.INSTANCE;
31303130
}
31313131

3132-
final List<String> keywords = new ArrayList<>();
3133-
boolean alsoSplat = false;
3134-
31353132
for (ParseNodeTuple pair : keywordHashArgumentNode.getPairs()) {
31363133
final ParseNode key = pair.getKey();
31373134
final ParseNode value = pair.getValue();
31383135

31393136
if (key instanceof SymbolParseNode &&
31403137
((SymbolParseNode) key).getName() != null) {
3141-
keywords.add(((SymbolParseNode) key).getName());
3138+
return KeywordArgumentsDescriptor.INSTANCE;
31423139
} else if (key == null && value != null) {
31433140
// A splat keyword hash
3144-
alsoSplat = true;
3141+
return KeywordArgumentsDescriptor.INSTANCE;
31453142
} else {
31463143
// For non-symbol keys
3147-
alsoSplat = true;
3144+
return KeywordArgumentsDescriptor.INSTANCE;
31483145
}
31493146
}
31503147

3151-
if (!keywords.isEmpty() || alsoSplat) {
3152-
return KeywordArgumentsDescriptor.INSTANCE;
3153-
} else {
3154-
return EmptyArgumentsDescriptor.INSTANCE;
3155-
}
3148+
return EmptyArgumentsDescriptor.INSTANCE;
31563149
}
31573150

31583151
private static HashParseNode findLastHashParseNode(ParseNode node) {

0 commit comments

Comments
 (0)