Skip to content

Commit

Permalink
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -116,8 +116,6 @@ public MulNode(MulNode prev) {

@Specialization
public RubyString multiply(RubyString string, int times) {
notDesignedForCompilation();

if (negativeTimesProfile.profile(times < 0)) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().argumentError("negative argument", this));
@@ -131,8 +129,10 @@ public RubyString multiply(RubyString string, int times) {
}

outputBytes.setEncoding(inputBytes.getEncoding());
final RubyString ret = getContext().makeString(string.getLogicalClass(), outputBytes);
ret.setCodeRange(string.getCodeRange());

return getContext().makeString(string.getLogicalClass(), outputBytes);
return ret;
}

@Specialization

0 comments on commit ebf1cf4

Please sign in to comment.