We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05b62f3 commit b3efc76Copy full SHA for b3efc76
src/main/java/org/truffleruby/core/string/TStringConstants.java
@@ -220,7 +220,9 @@ private static TruffleString ascii(String string) {
220
}
221
222
public static TruffleString lookupUSASCIITString(String string) {
223
- if (string.length() == 1) {
+ if (string.isEmpty()) {
224
+ return EMPTY_US_ASCII;
225
+ } else if (string.length() == 1) {
226
return US_ASCII_SINGLE_BYTE[string.charAt(0)];
227
} else {
228
return TSTRING_CONSTANTS.get(string);
0 commit comments