Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Unified Diff: runtime/lib/integers_patch.dart

Issue 15333006: Rewrite double.parse. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/lib/integers_patch.dart
diff --git a/runtime/lib/integers_patch.dart b/runtime/lib/integers_patch.dart
index 05d47cf9706ab72195f810be87dd9fd8012f550a..b6ea6e134852b845d71eee72ea7f25d8a09efef2 100644
--- a/runtime/lib/integers_patch.dart
+++ b/runtime/lib/integers_patch.dart
@@ -7,26 +7,20 @@
patch class int {
- static bool _isWhitespace(int codePoint) {
- return
- (codePoint == 32) || // Space.
- ((9 <= codePoint) && (codePoint <= 13)); // CR, LF, TAB, etc.
- }
-
static int _tryParseSmi(String str) {
if (str.isEmpty) return null;
var ix = 0;
var endIx = str.length - 1;
// Find first and last non-whitespace.
while (ix <= endIx) {
- if (!_isWhitespace(str.codeUnitAt(ix))) break;
+ if (!str._isWhitespace(str.codeUnitAt(ix))) break;
ix++;
}
if (endIx < ix) {
return null; // Empty.
}
while (endIx > ix) {
- if (!_isWhitespace(str.codeUnitAt(endIx))) break;
+ if (!str._isWhitespace(str.codeUnitAt(endIx))) break;
endIx--;
}

Powered by Google App Engine
This is Rietveld 408576698