Skip to content

Commit d754a37

Browse files
authored
Remove dead compareIosVersions function (#146298)
Dead all the back in flutter#10780
1 parent 77201fd commit d754a37

2 files changed

Lines changed: 0 additions & 38 deletions

File tree

packages/flutter_tools/lib/src/ios/simulators.dart

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -990,22 +990,6 @@ class _IOSSimulatorLogReader extends DeviceLogReader {
990990
}
991991
}
992992

993-
int compareIosVersions(String v1, String v2) {
994-
final List<int> v1Fragments = v1.split('.').map<int>(int.parse).toList();
995-
final List<int> v2Fragments = v2.split('.').map<int>(int.parse).toList();
996-
997-
int i = 0;
998-
while (i < v1Fragments.length && i < v2Fragments.length) {
999-
final int v1Fragment = v1Fragments[i];
1000-
final int v2Fragment = v2Fragments[i];
1001-
if (v1Fragment != v2Fragment) {
1002-
return v1Fragment.compareTo(v2Fragment);
1003-
}
1004-
i += 1;
1005-
}
1006-
return v1Fragments.length.compareTo(v2Fragments.length);
1007-
}
1008-
1009993
class _IOSSimulatorDevicePortForwarder extends DevicePortForwarder {
1010994
_IOSSimulatorDevicePortForwarder(this.device);
1011995

packages/flutter_tools/test/general.shard/ios/simulators_test.dart

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -140,28 +140,6 @@ void main() {
140140
});
141141
});
142142

143-
group('compareIosVersions', () {
144-
testWithoutContext('compares correctly', () {
145-
// This list must be sorted in ascending preference order
146-
final List<String> testList = <String>[
147-
'8', '8.0', '8.1', '8.2',
148-
'9', '9.0', '9.1', '9.2',
149-
'10', '10.0', '10.1',
150-
];
151-
152-
for (int i = 0; i < testList.length; i++) {
153-
expect(compareIosVersions(testList[i], testList[i]), 0);
154-
}
155-
156-
for (int i = 0; i < testList.length - 1; i++) {
157-
for (int j = i + 1; j < testList.length; j++) {
158-
expect(compareIosVersions(testList[i], testList[j]), lessThan(0));
159-
expect(compareIosVersions(testList[j], testList[i]), greaterThan(0));
160-
}
161-
}
162-
});
163-
});
164-
165143
group('sdkMajorVersion', () {
166144
late FakeSimControl simControl;
167145

0 commit comments

Comments
 (0)