Skip to content

Commit ef7dde5

Browse files
committed
Simplify condition in Hash.[]
* The storage of an array is never null anymore.
1 parent 8a8cd00 commit ef7dde5

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/main/java/org/truffleruby/core/hash/HashNodes.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,7 @@ protected Object construct(DynamicObject hashClass, Object[] args) {
9494
final DynamicObject pairArray = (DynamicObject) pair;
9595
final Object pairStore = Layouts.ARRAY.getStore(pairArray);
9696

97-
if ((pairStore != null && pairStore.getClass() != Object[].class) ||
98-
(Layouts.ARRAY.getSize(pairArray) != 2)) {
97+
if (pairStore.getClass() != Object[].class || Layouts.ARRAY.getSize(pairArray) != 2) {
9998
return fallbackNode.call(hashClass, "_constructor_fallback", args);
10099
}
101100

0 commit comments

Comments
 (0)