Skip to content

[CF] Add missing DEPLOYMENT_RUNTIME_SWIFT guard. #2594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CoreFoundation/Collections.subproj/CFArray.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,8 +971,10 @@ void CFArraySortValues(CFMutableArrayRef array, CFRange range, CFComparatorFunct
result = CF_OBJC_CALLV((NSMutableArray *)array, isKindOfClass:[NSMutableArray class]);
immutable = !result;
} else if (CF_IS_SWIFT(CFArrayGetTypeID(), array)) {
#if DEPLOYMENT_RUNTIME_SWIFT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we move this up one line, such that the else is inside the guard too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not strictly necessary, because CF_IS_SWIFT becomes (0) in CFinternal.h:733 when DEPLOYMENT_RUNTIME_SWIFT is undefined.

Let me know if you'd prefer it be moved, though, since it won't really hurt.

Boolean result = __CFSwiftBridge.NSArray.isSubclassOfNSMutableArray(array);
immutable = !result;
#endif
} else if (__kCFArrayImmutable == __CFArrayGetType(array)) {
immutable = true;
}
Expand Down