Skip to content

Commit

Permalink
Fix progress calculation in getAllPingableDevicesAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
kengu committed Feb 24, 2024
1 parent 90faa88 commit 2a11e1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/src/services/impls/host_scanner_service_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ class HostScannerServiceImpl extends HostScannerService {
],
);
} else if (message is SendableActiveHost) {
progressCallback
?.call((i - firstHostId) * 100 / (lastValidSubnet - firstHostId));
// print('Address ${message.address}');
final activeHostFound =
ActiveHost.fromSendableActiveHost(sendableActiveHost: message);
await activeHostFound.resolveInfo();
final j = int.tryParse(activeHostFound.hostId) ?? i;
progressCallback
?.call((j - firstHostId) * 100 / (lastValidSubnet - firstHostId));

Check warning on line 210 in lib/src/services/impls/host_scanner_service_impl.dart

View check run for this annotation

Codecov / codecov/patch

lib/src/services/impls/host_scanner_service_impl.dart#L210

Added line #L210 was not covered by tests
yield activeHostFound;
} else if (message is String && message == 'Done') {
isolate.kill();
Expand Down

0 comments on commit 2a11e1e

Please sign in to comment.