Skip to content

Commit 7ce927f

Browse files
committed
Fix String#to_f and treat \v as a whitespace character
1 parent a1e4b12 commit 7ce927f

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

spec/tags/core/string/to_f_tags.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
fails:String#to_f stops if the underscore is not followed or preceded by a number
2-
fails:String#to_f ignores leading and trailing whitespace
32
fails:String#to_f raises Encoding::CompatibilityError if String is in not ASCII-compatible encoding

src/main/java/org/truffleruby/core/string/DoubleConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private boolean isExponent(byte b) {
107107
}
108108

109109
private boolean isWhitespace(byte b) {
110-
return b == ' ' || (b <= 13 && b >= 9 && b != 11);
110+
return b == ' ' || (b >= 9 && b <= 13);
111111
}
112112

113113
private void addToResult(byte b) {

0 commit comments

Comments
 (0)