Skip to content

Commit

Permalink
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -957,17 +957,17 @@ public DynamicObject downcase(DynamicObject string) {
final ByteList bytes = codeRangeable.getByteList();
final Encoding encoding = bytes.getEncoding();

if (bytes.realSize() == 0) {
return nil();
}

if (encoding.isDummy()) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(
getContext().getCoreLibrary().encodingCompatibilityError(
String.format("incompatible encoding with this operation: %s", encoding), this));
}

if (bytes.realSize() == 0) {
return nil();
}

codeRangeable.modifyAndKeepCodeRange();

final boolean modified = StringSupport.multiByteDowncase(encoding, bytes.unsafeBytes(), bytes.begin(), bytes.realSize());

2 comments on commit bfa7d6c

@eregon
Copy link
Member

@eregon eregon commented on bfa7d6c Sep 28, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spec for it? :)

Sorry, something went wrong.

@nirvdrum
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's an MRI test, but I'll add a spec :-)

Sorry, something went wrong.

Please sign in to comment.