From 530bd189a9f3950126a072ad172b483b8ad1cdb9 Mon Sep 17 00:00:00 2001 From: Jonathan Flat Date: Mon, 30 Jun 2025 14:07:59 -0600 Subject: [PATCH] (154227191) Consolidate URL compatibility checks --- Sources/FoundationEssentials/URL/URL_Swift.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/FoundationEssentials/URL/URL_Swift.swift b/Sources/FoundationEssentials/URL/URL_Swift.swift index 3b0559187..7da7365e2 100644 --- a/Sources/FoundationEssentials/URL/URL_Swift.swift +++ b/Sources/FoundationEssentials/URL/URL_Swift.swift @@ -864,7 +864,7 @@ internal final class _SwiftURL: Sendable, Hashable, Equatable { /// `URL("/").deletingLastPathComponent == URL("/../")` /// `URL("/../").standardized == URL("")` #if FOUNDATION_FRAMEWORK - if URL.compatibility4 && path == "/" { + if URL.compatibility1 && path == "/" { components.percentEncodedPath = "/../" } else { components.percentEncodedPath = newPath @@ -915,7 +915,7 @@ internal final class _SwiftURL: Sendable, Hashable, Equatable { /// `URL("/../").standardized == URL("")` #if FOUNDATION_FRAMEWORK guard isDecomposable else { return nil } - let newPath = if URL.compatibility4 && _parseInfo.path == "/../" { + let newPath = if URL.compatibility1 && _parseInfo.path == "/../" { "" } else { String(_parseInfo.path).removingDotSegments