We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c4632d commit 087c0e2Copy full SHA for 087c0e2
Sources/LLVM/LLVM_Utils.swift
@@ -34,9 +34,15 @@ extension StaticString {
34
}
35
36
public func ==(lhs: llvm.StringRef, rhs: StaticString) -> Bool {
37
+#if $NewCxxMethodSafetyHeuristics
38
+ let lhsBuffer = UnsafeBufferPointer<UInt8>(
39
+ start: lhs.bytes_begin(),
40
+ count: Int(lhs.bytes_end() - lhs.bytes_begin()))
41
+#else
42
let lhsBuffer = UnsafeBufferPointer<UInt8>(
43
start: lhs.__bytes_beginUnsafe(),
44
count: Int(lhs.__bytes_endUnsafe() - lhs.__bytes_beginUnsafe()))
45
+#endif
46
return rhs.withUTF8Buffer { (rhsBuffer: UnsafeBufferPointer<UInt8>) in
47
if lhsBuffer.count != rhsBuffer.count { return false }
48
return lhsBuffer.elementsEqual(rhsBuffer, by: ==)
0 commit comments