Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 5c47af705cbd
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: bee9d0286a0a
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Dec 24, 2014

  1. Removed an unused reference.

    nirvdrum committed Dec 24, 2014
    Copy the full SHA
    2cc654b View commit details
  2. Copy the full SHA
    bee9d02 View commit details
Showing with 7 additions and 7 deletions.
  1. +7 −7 core/src/main/java/org/jruby/RubyString.java
14 changes: 7 additions & 7 deletions core/src/main/java/org/jruby/RubyString.java
Original file line number Diff line number Diff line change
@@ -7601,7 +7601,6 @@ public IRubyObject encode(ThreadContext context, IRubyObject toEncoding, IRubyOb
@JRubyMethod(name = "encode", compat = RUBY1_9)
public IRubyObject encode(ThreadContext context, IRubyObject toEncoding,
IRubyObject forcedEncoding, IRubyObject opts) {
Ruby runtime = context.runtime;

return EncodingUtils.strEncode(context, this, toEncoding, forcedEncoding, opts);
}
@@ -7616,8 +7615,11 @@ private static Encoding getEncoding(Ruby runtime, IRubyObject toEnc) {

@JRubyMethod(name = "force_encoding", compat = RUBY1_9)
public IRubyObject force_encoding(ThreadContext context, IRubyObject enc) {
return force_encoding(context, context.runtime.getEncodingService().getEncodingFromObject(enc));
}

private IRubyObject force_encoding(ThreadContext context, Encoding encoding) {
modify19();
Encoding encoding = context.runtime.getEncodingService().getEncodingFromObject(enc);
associateEncoding(encoding);
clearCodeRange();
return this;
@@ -7774,10 +7776,8 @@ public final int cat(byte[]bytes, int p, int len, Encoding enc, int ptr_cr) {

@JRubyMethod(name ="b", compat = RUBY2_0)
public IRubyObject b(ThreadContext context) {
Encoding encoding = ASCIIEncoding.INSTANCE;
RubyString dup = (RubyString)dup();
dup.associateEncoding(encoding);
dup.clearCodeRange();
return dup;
RubyString dup = strDup(context.runtime);

return dup.force_encoding(context, ASCIIEncoding.INSTANCE);
}
}