mirror of
https://github.com/dart-lang/sdk
synced 2024-07-01 07:14:29 +00:00
Avoid lint warning in TearOff benchmark
The throw_in_finally lint rule, which prohibits use of throw in finally blocks, is enabled in benchmarks/analysis_options.yaml. This change removes violations of this lint, so IDEs don't show problems with this file when analyzing the SDK. Bug: https://github.com/dart-lang/sdk/issues/54808 Change-Id: Idace8fb88ac26b86c2abd73787aafdee6f188af1 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/360720 Reviewed-by: Alexander Markov <alexmarkov@google.com> Commit-Queue: William Hesse <whesse@google.com>
This commit is contained in:
parent
be95daf4e4
commit
36be5e7318
|
@ -92,8 +92,9 @@ class BenchTearOffInlinedInTry extends BenchmarkBase {
|
|||
callIt(foo, 10);
|
||||
} finally {
|
||||
const int expectedSum = 20 * (20 - 1) ~/ 2;
|
||||
if (sum != expectedSum) throw 'Bad result: $sum';
|
||||
sum -= expectedSum;
|
||||
}
|
||||
if (sum != 0) throw 'Bad result: $sum';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -182,8 +183,9 @@ class BenchTearOffNotInlinedInTry extends BenchmarkBase {
|
|||
callIt(foo, 10);
|
||||
} finally {
|
||||
const int expectedSum = 20 * (20 - 1) ~/ 2;
|
||||
if (sum != expectedSum) throw 'Bad result: $sum';
|
||||
sum -= expectedSum;
|
||||
}
|
||||
if (sum != 0) throw 'Bad result: $sum';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user