Skip to content

Commit

Permalink
Use the correct ByteList when calculating string lengths.
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvdrum committed Jan 5, 2015
1 parent 34eb633 commit 9e53642
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/RubyString.java
Expand Up @@ -360,7 +360,7 @@ private int strLength(ByteList bytes) {
}

private int strLength(ByteList bytes, Encoding enc) {
if (isCodeRangeValid() && enc instanceof UTF8Encoding) return StringSupport.utf8Length(value);
if (isCodeRangeValid() && enc instanceof UTF8Encoding) return StringSupport.utf8Length(bytes);

long lencr = strLengthWithCodeRange(bytes, enc);
int cr = unpackArg(lencr);
Expand Down

0 comments on commit 9e53642

Please sign in to comment.