From dc59e96cff056f46051777feee220b75bd0a3878 Mon Sep 17 00:00:00 2001 From: Ruslan Alikhamov Date: Mon, 23 Oct 2023 22:02:35 +0400 Subject: [PATCH] removed redundant variable --- Sources/SwiftSyntax/SyntaxText.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Sources/SwiftSyntax/SyntaxText.swift b/Sources/SwiftSyntax/SyntaxText.swift index 475c78c27a2..c5068a76aa4 100644 --- a/Sources/SwiftSyntax/SyntaxText.swift +++ b/Sources/SwiftSyntax/SyntaxText.swift @@ -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(self.baseAddress! + count) let otherEndBound = UnsafePointer(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``.