1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-08 12:06:26 +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:
Stephen Adams 2021-01-11 17:42:06 +00:00 committed by commit-bot@chromium.org
parent a173599f4c
commit d5335340f4
2 changed files with 10 additions and 10 deletions

View File

@ -33,13 +33,13 @@ const requiredDigits = 11106;
class Benchmark extends BenchmarkBase {
final List<String> strings;
Benchmark(String name, int bits, {bool forInt: false})
Benchmark(String name, int bits, {bool forInt = false})
: strings = generateStrings(bits, forInt),
super(name);
static List<String> generateStrings(int bits, bool forInt) {
List<String> strings = [];
BigInt seed = (BigInt.one << bits) - BigInt.one;
final List<String> strings = [];
final BigInt seed = (BigInt.one << bits) - BigInt.one;
var b = seed;
var restartDelta = BigInt.zero;
var totalLength = 0;
@ -130,7 +130,7 @@ class FormatBigIntBenchmark extends Benchmark {
@override
void setup() {
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.
}
}
@ -158,7 +158,7 @@ class FormatIntBenchmark extends Benchmark {
@override
void setup() {
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.
}
}

View File

@ -35,13 +35,13 @@ const requiredDigits = 11106;
class Benchmark extends BenchmarkBase {
final List<String> strings;
Benchmark(String name, int bits, {bool forInt: false})
Benchmark(String name, int bits, {bool forInt = false})
: strings = generateStrings(bits, forInt),
super(name);
static List<String> generateStrings(int bits, bool forInt) {
List<String> strings = [];
BigInt seed = (BigInt.one << bits) - BigInt.one;
final List<String> strings = [];
final BigInt seed = (BigInt.one << bits) - BigInt.one;
var b = seed;
var restartDelta = BigInt.zero;
var totalLength = 0;
@ -132,7 +132,7 @@ class FormatBigIntBenchmark extends Benchmark {
@override
void setup() {
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.
}
}
@ -160,7 +160,7 @@ class FormatIntBenchmark extends Benchmark {
@override
void setup() {
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.
}
}