From 5e3d3e2915f9ccc561da6dbebca6f33155f06f66 Mon Sep 17 00:00:00 2001 From: Maxim Makhun Date: Tue, 20 Apr 2021 15:57:44 -0700 Subject: [PATCH] Remove excessive logging from `Intersection` encoder. --- Cartfile.resolved | 2 +- Sources/MapboxDirections/Intersection.swift | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Cartfile.resolved b/Cartfile.resolved index 83330e8c6..8af9a9f5c 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -1,6 +1,6 @@ binary "https://www.mapbox.com/ios-sdk/Mapbox-iOS-SDK.json" "5.9.0" github "AliSoftware/OHHTTPStubs" "9.1.0" github "Udumft/SwiftCLI" "da19d2a16cd5aa838d8fb7256e28c171bc67dd82" -github "mapbox/mapbox-events-ios" "v0.10.7" +github "mapbox/mapbox-events-ios" "v0.10.8" github "mapbox/turf-swift" "v2.0.0-alpha.3" github "raphaelmor/Polyline" "v5.0.2" diff --git a/Sources/MapboxDirections/Intersection.swift b/Sources/MapboxDirections/Intersection.swift index 291190e3e..371a4af94 100644 --- a/Sources/MapboxDirections/Intersection.swift +++ b/Sources/MapboxDirections/Intersection.swift @@ -260,20 +260,22 @@ extension Intersection: Codable { try container.encode(outletArray, forKey: .outletIndexes) var lanes: [Lane]? - print("lanes: \(String(describing: lanes))") if let approachLanes = approachLanes, let usableApproachLanes = usableApproachLanes, let preferredApproachLanes = preferredApproachLanes { lanes = approachLanes.map { Lane(indications: $0) } for i in usableApproachLanes { - lanes![i].isValid = true - if usableLaneIndication != nil && lanes![i].indications.descriptions.contains(usableLaneIndication!.rawValue) { - lanes![i].validIndication = usableLaneIndication + lanes?[i].isValid = true + if let usableLaneIndication = usableLaneIndication, + let validLanes = lanes, + validLanes[i].indications.descriptions.contains(usableLaneIndication.rawValue) { + lanes?[i].validIndication = usableLaneIndication } } + for j in preferredApproachLanes { - lanes![j].isActive = true + lanes?[j].isActive = true } } try container.encodeIfPresent(lanes, forKey: .lanes)