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

Unified Diff: pkg/intl/lib/date_format_helpers.dart

Issue 10829442: Rename i18n to intl (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 4 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: pkg/intl/lib/date_format_helpers.dart
===================================================================
--- pkg/intl/lib/date_format_helpers.dart (revision 10991)
+++ pkg/intl/lib/date_format_helpers.dart (working copy)
@@ -125,14 +125,11 @@
* Assuming that the contents are characters, read as many digits as we
* can see and then return the corresponding integer. Advance the stream.
*/
- var digitMatcher = const RegExp(@'\d');
+ var digitMatcher = const RegExp(@'\d+');
int nextInteger() {
- // Doing this with a regular expression is slightly slower on the VM,
- // but makes a moderate difference in Javascript right now.
- var digits = [];
- while (!atEnd() && (digitMatcher.hasMatch(peek()))) {
- digits.add(next().charCodeAt(0));
- }
- return Math.parseInt(new String.fromCharCodes(digits));
+ var string = digitMatcher.stringMatch(rest());
+ if (string == null || string.isEmpty()) return null;
+ read(string.length);
+ return Math.parseInt(string);
}
}
« no previous file with comments | « pkg/intl/lib/date_format_field.dart ('k') | pkg/intl/pubspec.yaml » ('j') | tools/create_sdk.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698