Skip to content

[for stdlib] Switch _sanityCheck for assert #1640

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 1 commit into from
Jul 25, 2018
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
4 changes: 2 additions & 2 deletions Foundation/NSStringAPI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,7 @@ extension StringProtocol where Index == String.Index {
public func contains<T : StringProtocol>(_ other: T) -> Bool {
let r = self.range(of: other) != nil
if #available(macOS 10.10, iOS 8.0, *) {
_sanityCheck(r == _ns.contains(other._ephemeralString))
assert(r == _ns.contains(other._ephemeralString))
}
return r
}
Expand All @@ -1660,7 +1660,7 @@ extension StringProtocol where Index == String.Index {
of: other, options: .caseInsensitive, locale: Locale.current
) != nil
if #available(macOS 10.10, iOS 8.0, *) {
_sanityCheck(r ==
assert(r ==
_ns.localizedCaseInsensitiveContains(other._ephemeralString))
}
return r
Expand Down