Skip to content

Commit 16682d5

Browse files
committed
Move asserts from initializer list to body
1 parent 52597c5 commit 16682d5

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

app/lib/search/token_index.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class TokenIndex<K> {
4040
List<K> ids,
4141
List<String?> values, {
4242
bool skipDocumentWeight = false,
43-
}) : _ids = ids,
44-
assert(ids.length == values.length) {
43+
}) : _ids = ids {
44+
assert(ids.length == values.length);
4545
final length = values.length;
4646
for (var i = 0; i < length; i++) {
4747
final text = values[i];

app/lib/tool/neat_task/datastore_status_provider.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class NeatTaskStatus extends db.ExpandoModel<String> {
4848
runtimeVersion =
4949
_runtimeVersion(name, isRuntimeVersioned: isRuntimeVersioned),
5050
updated = clock.now().toUtc() {
51+
// Not in initializer list as id is declared in a super class.
5152
id = _compositeId(name, isRuntimeVersioned: isRuntimeVersioned);
5253
}
5354
}

pkg/_popularity/lib/popularity.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ class VoteData {
7070

7171
int get score => _score(this);
7272

73-
VoteData(this.direct, this.dev, this.total)
74-
: assert(direct >= 0 && direct <= total),
75-
assert(dev >= 0 && dev <= total);
73+
VoteData(this.direct, this.dev, this.total) {
74+
assert(direct >= 0 && direct <= total);
75+
assert(dev >= 0 && dev <= total);
76+
}
7677

7778
factory VoteData.fromJson(Map<String, dynamic> json) =>
7879
_$VoteDataFromJson(json);

0 commit comments

Comments
 (0)