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

Unified Diff: pkg/fixnum/lib/src/int32.dart

Issue 23441004: More efficient Int64 parsing and printing. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
« no previous file with comments | « no previous file | pkg/fixnum/lib/src/int64.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/fixnum/lib/src/int32.dart
diff --git a/pkg/fixnum/lib/src/int32.dart b/pkg/fixnum/lib/src/int32.dart
index fb78a48fd6e41c3442f13a3737dc9ee07a39cb3b..85fbdc460d892ce4fa07f19e2c16153875cc8c1c 100644
--- a/pkg/fixnum/lib/src/int32.dart
+++ b/pkg/fixnum/lib/src/int32.dart
@@ -45,7 +45,7 @@ class Int32 implements IntX {
static const int _CC_A = 65; // 'A'.codeUnitAt(0)
static const int _CC_Z = 90; // 'Z'.codeUnitAt(0)
- static int _decodeHex(int c) {
+ static int _decodeDigit(int c) {
if (c >= _CC_0 && c <= _CC_9) {
return c - _CC_0;
} else if (c >= _CC_a && c <= _CC_z) {
@@ -69,7 +69,7 @@ class Int32 implements IntX {
Int32 x = ZERO;
for (int i = 0; i < s.length; i++) {
int c = s.codeUnitAt(i);
- int digit = _decodeHex(c);
+ int digit = _decodeDigit(c);
if (digit < 0 || digit >= radix) {
throw new Exception("Non-radix code unit: $c");
}
« no previous file with comments | « no previous file | pkg/fixnum/lib/src/int64.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698