mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Add isTriviallyIdentical for unicode views
This commit is contained in:
committed by
Rick van Voorden
parent
c8202c6f9a
commit
be5ec1aed4
@@ -1056,3 +1056,14 @@ extension String.UTF16View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension String.UTF16View {
|
||||
/// Returns a boolean value indicating whether this UTF16 view
|
||||
/// is trivially identical to `other`.
|
||||
///
|
||||
/// - Complexity: O(1)
|
||||
@_alwaysEmitIntoClient
|
||||
public func isTriviallyIdentical(to other: Self) -> Bool {
|
||||
self._guts.rawBits == other._guts.rawBits
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user