Skip to content

Commit

Permalink
realign 2.5 String#casecmp?
Browse files Browse the repository at this point in the history
  • Loading branch information
lopex committed Apr 9, 2018
1 parent b0af815 commit fe1f588
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/src/main/java/org/jruby/RubyString.java
Expand Up @@ -1635,9 +1635,10 @@ public IRubyObject casecmp_p(ThreadContext context, IRubyObject other) {
Encoding enc = StringSupport.areCompatible(this, otherStr);
if (enc == null) return context.nil;

RubyString downcasedString = this.downcase(context, RubyObject.NULL_ARRAY);
RubyString otherDowncasedString = otherStr.downcase(context, RubyObject.NULL_ARRAY);
return downcasedString.equals(otherDowncasedString) ? context.runtime.getTrue() : context.runtime.getFalse();
IRubyObject[] args = new IRubyObject[] {runtime.newSymbol("fold")};
RubyString downcasedString = this.downcase(context, args);
RubyString otherDowncasedString = otherStr.downcase(context, args);
return downcasedString.equals(otherDowncasedString) ? runtime.getTrue() : runtime.getFalse();
}

/** rb_str_match
Expand Down

0 comments on commit fe1f588

Please sign in to comment.