Skip to content

Remove available branching for macOS <12 #11259

@jathu

Description

@jathu

We recently bumped the minimum target macOS version to 12.0. So, comb through the code and remove branching where the macOS version is below 12.0.

Search for @available:

grep "@available"

Example of a candidate where we branch on a macOS min version of 11.0:

if (@available(macOS 11.0, iOS 16.0, tvOS 16.0, watchOS 9.0, *)) {
NSMutableDictionary<NSString *, id> *output_backings = [NSMutableDictionary dictionary];
NSEnumerator<NSString *> *enumerator = [output_names objectEnumerator];
for (MLMultiArray *output in outputs) {
NSString *output_name = [enumerator nextObject];
if (output_name.length == 0) {
ETCoreMLLogErrorAndSetNSError(error, ETCoreMLErrorCorruptedModel, "Model is broken.");
return nil;
}
output_backings[output_name] = output;
}
options.outputBackings = output_backings;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions