File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/str Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1827,21 +1827,21 @@ abstract static class IsUpperNode extends PythonUnaryBuiltinNode {
1827
1827
@ Specialization
1828
1828
@ TruffleBoundary
1829
1829
boolean doString (String self ) {
1830
- int spaces = 0 ;
1830
+ int uncased = 0 ;
1831
1831
if (self .length () == 0 ) {
1832
1832
return false ;
1833
1833
}
1834
1834
for (int i = 0 ; i < self .length (); i ++) {
1835
1835
int codePoint = self .codePointAt (i );
1836
1836
if (!Character .isUpperCase (codePoint )) {
1837
- if (Character .isWhitespace (codePoint )) {
1838
- spaces ++;
1837
+ if (Character .toLowerCase ( codePoint ) == Character . toUpperCase (codePoint )) {
1838
+ uncased ++;
1839
1839
} else {
1840
1840
return false ;
1841
1841
}
1842
1842
}
1843
1843
}
1844
- return spaces == 0 || self .length () > spaces ;
1844
+ return uncased == 0 || self .length () > uncased ;
1845
1845
1846
1846
}
1847
1847
}
You can’t perform that action at this time.
0 commit comments