@@ -248,21 +248,6 @@ def _is_macos(platform):
248
248
"""
249
249
return platform .platform_type == apple_common .platform_type .macos
250
250
251
- def _trim_version (version ):
252
- """Trim the given version number down to a maximum of three components.
253
-
254
- Args:
255
- version: The version number to trim; either a string or a
256
- `DottedVersion` value.
257
-
258
- Returns:
259
- The trimmed version number as a `DottedVersion` value.
260
- """
261
- version = str (version )
262
- parts = version .split ("." )
263
- maxparts = min (len (parts ), 3 )
264
- return apple_common .dotted_version ("." .join (parts [:maxparts ]))
265
-
266
251
def _is_xcode_at_least_version (xcode_config , desired_version ):
267
252
"""Returns True if we are building with at least the given Xcode version.
268
253
@@ -281,10 +266,8 @@ def _is_xcode_at_least_version(xcode_config, desired_version):
281
266
"Xcode isn't available; if you think this is a mistake, please " +
282
267
"file an issue." )
283
268
284
- # TODO(b/131195460): DottedVersion comparison is broken for four-component
285
- # versions that are returned by modern Xcodes. Work around it for now.
286
- desired_version_value = _trim_version (desired_version )
287
- return _trim_version (current_version ) >= desired_version_value
269
+ desired_version_value = apple_common .dotted_version (desired_version )
270
+ return current_version >= desired_version_value
288
271
289
272
def _swift_apple_target_triple (cpu , platform , version ):
290
273
"""Returns a target triple string for an Apple platform.
0 commit comments