Skip to content

Commit d0cc57c

Browse files
committed
[Truffle] Real implementation of String#empty?.
1 parent ad4a92e commit d0cc57c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

truffle/src/main/java/org/jruby/truffle/nodes/core/StringNodes.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -768,9 +768,7 @@ public EmptyNode(EmptyNode prev) {
768768

769769
@Specialization
770770
public boolean empty(RubyString string) {
771-
notDesignedForCompilation();
772-
773-
return string.toString().isEmpty();
771+
return string.getBytes().length() == 0;
774772
}
775773
}
776774

0 commit comments

Comments
 (0)