Skip to content

Commit 4cb3c44

Browse files
committed
Make an empty hash shift return nil.
1 parent fbbc027 commit 4cb3c44

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,9 +511,9 @@ protected Object setDefault(RubyHash hash, Object defaultValue,
511511
public abstract static class ShiftNode extends CoreMethodArrayArgumentsNode {
512512

513513
@Specialization(guards = "hash.empty()")
514-
protected Object shiftEmpty(RubyHash hash,
514+
protected Nil shiftEmpty(RubyHash hash,
515515
@Cached DispatchNode callDefault) {
516-
return callDefault.call(hash, "default", nil);
516+
return nil;
517517
}
518518

519519
@Specialization(guards = "!hash.empty()", limit = "hashStrategyLimit()")

0 commit comments

Comments
 (0)