Skip to content

Commit

Permalink
removed redundant variable
Browse files Browse the repository at this point in the history
  • Loading branch information
art-divin committed Oct 23, 2023
1 parent ff95302 commit dc59e96
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Sources/SwiftSyntax/SyntaxText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,9 @@ public struct SyntaxText {
guard !self.isEmpty && !other.isEmpty else {
return self.isEmpty && other.isEmpty
}
let isSelfBaseAddressBiggerThanOther: Bool = other.baseAddress! <= self.baseAddress!
let selfEndBound = UnsafePointer<UInt8>(self.baseAddress! + count)
let otherEndBound = UnsafePointer<UInt8>(other.baseAddress! + other.count)
return (isSelfBaseAddressBiggerThanOther && selfEndBound <= otherEndBound)
return (other.baseAddress! <= self.baseAddress!) && (selfEndBound <= otherEndBound)
}

/// Returns `true` if `other` is a substring of this ``SyntaxText``.
Expand Down

0 comments on commit dc59e96

Please sign in to comment.