Skip to content

Commit

Permalink
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/RubyString.java
Original file line number Diff line number Diff line change
@@ -1141,9 +1141,9 @@ private IRubyObject op_equalCommon(ThreadContext context, IRubyObject other) {
return sites(context).equals.call(context, this, other, this).isTrue() ? runtime.getTrue() : runtime.getFalse();
}

@JRubyMethod(name = "-@") // -'foo' returns deduplicated (interned) string
@JRubyMethod(name = "-@") // -'foo' returns frozen string
public final IRubyObject minus_at(ThreadContext context) {
return context.runtime.freezeAndDedupString(this);
return isFrozen() ? this : context.runtime.freezeAndDedupString(this);
}

@JRubyMethod(name = "+@") // +'foo' returns modifiable string

0 comments on commit 5a8d17b

Please sign in to comment.