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

Unified Diff: lib/uri/encode_decode.dart

Issue 10913271: Move parseInt parseDouble to int/double classes as a static method. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Make int.parse directly native. Created 8 years, 3 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
« no previous file with comments | « lib/math/base.dart ('k') | lib/uri/uri.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/uri/encode_decode.dart
diff --git a/lib/uri/encode_decode.dart b/lib/uri/encode_decode.dart
index 540b7e6fbd6f60cd0ebf8c7de95583eb00110787..511bce05dfdb8bf5a56df64fc72fc640e6b399b7 100644
--- a/lib/uri/encode_decode.dart
+++ b/lib/uri/encode_decode.dart
@@ -107,11 +107,12 @@ String _uriEncode(String canonical, String text) {
*/
int _hexCharPairToByte(String s, int pos) {
- // An alternative to calling parseInt twice would be to take a
+ // An alternative to calling [int.parse] twice would be to take a
// two character substring and call it once, but that may be less
// efficient.
- int d1 = parseInt("0x${s[pos]}");
- int d2 = parseInt("0x${s[pos+1]}");
+ // TODO(lrn): I fail to see how that could possibly be slower than this.
+ int d1 = int.parse("0x${s[pos]}");
+ int d2 = int.parse("0x${s[pos+1]}");
return d1 * 16 + d2;
}
« no previous file with comments | « lib/math/base.dart ('k') | lib/uri/uri.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698