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

Unified Diff: runtime/lib/integers.dart

Issue 723963006: Specialize _toPow2String for bigint to make it linear instead of quadratic. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 1 month 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 | « runtime/lib/bigint.dart ('k') | tests/corelib/big_integer_parsed_arith_vm_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/integers.dart
===================================================================
--- runtime/lib/integers.dart (revision 41724)
+++ runtime/lib/integers.dart (working copy)
@@ -220,7 +220,7 @@
throw new ArgumentError(radix);
}
if (radix & (radix - 1) == 0) {
- return _toPow2String(this, radix);
+ return _toPow2String(radix);
}
if (radix == 10) return this.toString();
final bool isNegative = this < 0;
@@ -240,7 +240,8 @@
return string;
}
- static String _toPow2String(value, radix) {
+ String _toPow2String(int radix) {
+ int value = this;
if (value == 0) return "0";
assert(radix & (radix - 1) == 0);
var negative = value < 0;
« no previous file with comments | « runtime/lib/bigint.dart ('k') | tests/corelib/big_integer_parsed_arith_vm_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698