Skip to content

Commit

Permalink
Fix dart analyze warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
inetic committed Dec 2, 2024
1 parent c594c45 commit 5e06b58
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion bindings/dart/lib/client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ class Subscriptions {
}

void close() {
_sinks.values.forEach((sink) => sink.close());
for (var sink in _sinks.values) {
sink.close();
}
_sinks.clear();
}
}
Expand Down
5 changes: 3 additions & 2 deletions bindings/dart/lib/internal/message_matcher.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:async';
import 'dart:typed_data';
import 'dart:collection';
import 'package:flutter/services.dart';
import 'package:msgpack_dart/msgpack_dart.dart';

import '../client.dart';
Expand Down Expand Up @@ -103,7 +102,9 @@ class MessageMatcher {
_isClosed = true;
_subscriptions.close();
final error = SessionClosed();
_responses.values.forEach((i) => i.completeError(error));
for (var i in _responses.values) {
i.completeError(error);
}
_responses.clear();
}

Expand Down
4 changes: 1 addition & 3 deletions bindings/dart/lib/ouisync.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ class Session {

final recvPort = ReceivePort();

if (bindings == null) {
bindings = Bindings.loadDefault();
}
bindings ??= Bindings.loadDefault();

final result = _withPoolSync((pool) => bindings!.session_create(
kind.encode(),
Expand Down

0 comments on commit 5e06b58

Please sign in to comment.