Remove unnecessary null checks in dev/devicelab (#118842)

This commit is contained in:
Michael Goderbauer
2023-01-20 10:56:44 -08:00
committed by GitHub
parent f291eb3495
commit ab3c82244e
9 changed files with 12 additions and 74 deletions

View File

@@ -2042,10 +2042,7 @@ class _UnzipListEntry {
required this.uncompressedSize,
required this.compressedSize,
required this.path,
}) : assert(uncompressedSize != null),
assert(compressedSize != null),
assert(compressedSize <= uncompressedSize),
assert(path != null);
}) : assert(compressedSize <= uncompressedSize);
final int uncompressedSize;
final int compressedSize;

View File

@@ -161,11 +161,11 @@ Future<TaskResult> runWebBenchmark({ required bool useCanvasKit }) async {
final String namespace = '$benchmarkName.$backend';
final List<String> scoreKeys = List<String>.from(profile['scoreKeys'] as List<dynamic>);
if (scoreKeys == null || scoreKeys.isEmpty) {
if (scoreKeys.isEmpty) {
throw 'No score keys in benchmark "$benchmarkName"';
}
for (final String scoreKey in scoreKeys) {
if (scoreKey == null || scoreKey.isEmpty) {
if (scoreKey.isEmpty) {
throw 'Score key is empty in benchmark "$benchmarkName". '
'Received [${scoreKeys.join(', ')}]';
}