Skip to content

Commit c09463d

Browse files
committed
Address sharing warnings for ArrayCanContainObjectNode
1 parent 71ad391 commit c09463d

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

src/main/java/org/truffleruby/core/array/ArrayNodes.java

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2469,22 +2469,11 @@ public static ArrayCanContainObjectNode create() {
24692469

24702470
public abstract boolean execute(RubyArray array);
24712471

2472-
@Specialization(
2473-
guards = {
2474-
"stores.accepts(array.getStore())",
2475-
"stores.isPrimitive(array.getStore())" })
2476-
protected boolean primitiveArray(RubyArray array,
2477-
@CachedLibrary(limit = "storageStrategyLimit()") ArrayStoreLibrary stores) {
2478-
return false;
2479-
}
2480-
2481-
@Specialization(
2482-
guards = {
2483-
"stores.accepts(array.getStore())",
2484-
"!stores.isPrimitive(array.getStore())" })
2485-
protected boolean objectArray(RubyArray array,
2486-
@CachedLibrary(limit = "storageStrategyLimit()") ArrayStoreLibrary stores) {
2487-
return true;
2472+
@Specialization(limit = "storageStrategyLimit()")
2473+
protected boolean array(RubyArray array,
2474+
@Bind("array.getStore()") Object store,
2475+
@CachedLibrary("store") ArrayStoreLibrary stores) {
2476+
return !stores.isPrimitive(store);
24882477
}
24892478

24902479
@Specialization(guards = "!isRubyArray(array)")

0 commit comments

Comments
 (0)