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 f5d0a3a commit 83ad08cCopy full SHA for 83ad08c
Sources/SwiftSyntax/SyntaxText.swift
@@ -100,7 +100,10 @@ public struct SyntaxText {
100
guard !self.isEmpty && !other.isEmpty else {
101
return self.isEmpty && other.isEmpty
102
}
103
- return (other.baseAddress! <= self.baseAddress! && self.baseAddress! + count <= other.baseAddress! + other.count)
+ let first: Bool = other.baseAddress! <= self.baseAddress!
104
+ let second = UnsafePointer<UInt8>(self.baseAddress! + count)
105
+ let third = UnsafePointer<UInt8>(other.baseAddress! + other.count)
106
+ return (first && second <= third)
107
108
109
/// Returns `true` if `other` is a substring of this ``SyntaxText``.
0 commit comments