Skip to content

Commit

Permalink
Remove dead compareIosVersions function (#146298)
Browse files Browse the repository at this point in the history
Dead all the back in #10780
  • Loading branch information
jmagman authored Apr 4, 2024
1 parent 77201fd commit d754a37
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 38 deletions.
16 changes: 0 additions & 16 deletions packages/flutter_tools/lib/src/ios/simulators.dart
Original file line number Diff line number Diff line change
Expand Up @@ -990,22 +990,6 @@ class _IOSSimulatorLogReader extends DeviceLogReader {
}
}

int compareIosVersions(String v1, String v2) {
final List<int> v1Fragments = v1.split('.').map<int>(int.parse).toList();
final List<int> v2Fragments = v2.split('.').map<int>(int.parse).toList();

int i = 0;
while (i < v1Fragments.length && i < v2Fragments.length) {
final int v1Fragment = v1Fragments[i];
final int v2Fragment = v2Fragments[i];
if (v1Fragment != v2Fragment) {
return v1Fragment.compareTo(v2Fragment);
}
i += 1;
}
return v1Fragments.length.compareTo(v2Fragments.length);
}

class _IOSSimulatorDevicePortForwarder extends DevicePortForwarder {
_IOSSimulatorDevicePortForwarder(this.device);

Expand Down
22 changes: 0 additions & 22 deletions packages/flutter_tools/test/general.shard/ios/simulators_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,28 +140,6 @@ void main() {
});
});

group('compareIosVersions', () {
testWithoutContext('compares correctly', () {
// This list must be sorted in ascending preference order
final List<String> testList = <String>[
'8', '8.0', '8.1', '8.2',
'9', '9.0', '9.1', '9.2',
'10', '10.0', '10.1',
];

for (int i = 0; i < testList.length; i++) {
expect(compareIosVersions(testList[i], testList[i]), 0);
}

for (int i = 0; i < testList.length - 1; i++) {
for (int j = i + 1; j < testList.length; j++) {
expect(compareIosVersions(testList[i], testList[j]), lessThan(0));
expect(compareIosVersions(testList[j], testList[i]), greaterThan(0));
}
}
});
});

group('sdkMajorVersion', () {
late FakeSimControl simControl;

Expand Down

0 comments on commit d754a37

Please sign in to comment.