mirror of
https://github.com/dart-lang/sdk
synced 2024-10-14 09:22:12 +00:00
[benchmark] BigIntParsePrint: fix lints
Change-Id: Id0b131e9127b4b57bf88d376cb17d3b3676dfa6d Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177740 Reviewed-by: Jonas Termansen <sortie@google.com> Commit-Queue: Stephen Adams <sra@google.com>
This commit is contained in:
parent
a173599f4c
commit
d5335340f4
|
@ -33,13 +33,13 @@ const requiredDigits = 11106;
|
||||||
|
|
||||||
class Benchmark extends BenchmarkBase {
|
class Benchmark extends BenchmarkBase {
|
||||||
final List<String> strings;
|
final List<String> strings;
|
||||||
Benchmark(String name, int bits, {bool forInt: false})
|
Benchmark(String name, int bits, {bool forInt = false})
|
||||||
: strings = generateStrings(bits, forInt),
|
: strings = generateStrings(bits, forInt),
|
||||||
super(name);
|
super(name);
|
||||||
|
|
||||||
static List<String> generateStrings(int bits, bool forInt) {
|
static List<String> generateStrings(int bits, bool forInt) {
|
||||||
List<String> strings = [];
|
final List<String> strings = [];
|
||||||
BigInt seed = (BigInt.one << bits) - BigInt.one;
|
final BigInt seed = (BigInt.one << bits) - BigInt.one;
|
||||||
var b = seed;
|
var b = seed;
|
||||||
var restartDelta = BigInt.zero;
|
var restartDelta = BigInt.zero;
|
||||||
var totalLength = 0;
|
var totalLength = 0;
|
||||||
|
@ -130,7 +130,7 @@ class FormatBigIntBenchmark extends Benchmark {
|
||||||
@override
|
@override
|
||||||
void setup() {
|
void setup() {
|
||||||
for (String s in strings) {
|
for (String s in strings) {
|
||||||
BigInt b = BigInt.parse(s);
|
final BigInt b = BigInt.parse(s);
|
||||||
values.add(b - BigInt.one); // We add 'one' back later.
|
values.add(b - BigInt.one); // We add 'one' back later.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -158,7 +158,7 @@ class FormatIntBenchmark extends Benchmark {
|
||||||
@override
|
@override
|
||||||
void setup() {
|
void setup() {
|
||||||
for (String s in strings) {
|
for (String s in strings) {
|
||||||
int b = int.parse(s);
|
final int b = int.parse(s);
|
||||||
values.add(b - 4096); // We add this back later.
|
values.add(b - 4096); // We add this back later.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,13 +35,13 @@ const requiredDigits = 11106;
|
||||||
|
|
||||||
class Benchmark extends BenchmarkBase {
|
class Benchmark extends BenchmarkBase {
|
||||||
final List<String> strings;
|
final List<String> strings;
|
||||||
Benchmark(String name, int bits, {bool forInt: false})
|
Benchmark(String name, int bits, {bool forInt = false})
|
||||||
: strings = generateStrings(bits, forInt),
|
: strings = generateStrings(bits, forInt),
|
||||||
super(name);
|
super(name);
|
||||||
|
|
||||||
static List<String> generateStrings(int bits, bool forInt) {
|
static List<String> generateStrings(int bits, bool forInt) {
|
||||||
List<String> strings = [];
|
final List<String> strings = [];
|
||||||
BigInt seed = (BigInt.one << bits) - BigInt.one;
|
final BigInt seed = (BigInt.one << bits) - BigInt.one;
|
||||||
var b = seed;
|
var b = seed;
|
||||||
var restartDelta = BigInt.zero;
|
var restartDelta = BigInt.zero;
|
||||||
var totalLength = 0;
|
var totalLength = 0;
|
||||||
|
@ -132,7 +132,7 @@ class FormatBigIntBenchmark extends Benchmark {
|
||||||
@override
|
@override
|
||||||
void setup() {
|
void setup() {
|
||||||
for (String s in strings) {
|
for (String s in strings) {
|
||||||
BigInt b = BigInt.parse(s);
|
final BigInt b = BigInt.parse(s);
|
||||||
values.add(b - BigInt.one); // We add 'one' back later.
|
values.add(b - BigInt.one); // We add 'one' back later.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ class FormatIntBenchmark extends Benchmark {
|
||||||
@override
|
@override
|
||||||
void setup() {
|
void setup() {
|
||||||
for (String s in strings) {
|
for (String s in strings) {
|
||||||
int b = int.parse(s);
|
final int b = int.parse(s);
|
||||||
values.add(b - 4096); // We add this back later.
|
values.add(b - 4096); // We add this back later.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue