diff --git a/packages/flutter_tools/lib/src/ios/simulators.dart b/packages/flutter_tools/lib/src/ios/simulators.dart index 5ebd629f03..2ee83a3674 100644 --- a/packages/flutter_tools/lib/src/ios/simulators.dart +++ b/packages/flutter_tools/lib/src/ios/simulators.dart @@ -990,22 +990,6 @@ class _IOSSimulatorLogReader extends DeviceLogReader { } } -int compareIosVersions(String v1, String v2) { - final List v1Fragments = v1.split('.').map(int.parse).toList(); - final List v2Fragments = v2.split('.').map(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); diff --git a/packages/flutter_tools/test/general.shard/ios/simulators_test.dart b/packages/flutter_tools/test/general.shard/ios/simulators_test.dart index 3748510c95..f19adbde8b 100644 --- a/packages/flutter_tools/test/general.shard/ios/simulators_test.dart +++ b/packages/flutter_tools/test/general.shard/ios/simulators_test.dart @@ -140,28 +140,6 @@ void main() { }); }); - group('compareIosVersions', () { - testWithoutContext('compares correctly', () { - // This list must be sorted in ascending preference order - final List testList = [ - '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;