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