From 9ffceb38782cf4940beece99888942b732d11f88 Mon Sep 17 00:00:00 2001 From: Scott Perry Date: Tue, 6 Apr 2021 07:44:35 -0700 Subject: [PATCH] Use `elements` to manifest an Array from an OrderedSet Co-authored-by: Karoy Lorentey --- Sources/OrderedCollections/OrderedSet/OrderedSet+Diffing.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Sources/OrderedCollections/OrderedSet/OrderedSet+Diffing.swift b/Sources/OrderedCollections/OrderedSet/OrderedSet+Diffing.swift index 7c91a6c0..3724d0fa 100644 --- a/Sources/OrderedCollections/OrderedSet/OrderedSet+Diffing.swift +++ b/Sources/OrderedCollections/OrderedSet/OrderedSet+Diffing.swift @@ -93,9 +93,8 @@ extension OrderedSet { /// is the number of changes contained by the parameter. @available(macOS 10.15, iOS 13, tvOS 13, watchOS 6, *) public func applying(_ difference: CollectionDifference) -> Self? { - guard let array = Array(self).applying(difference) else { return nil } + guard let array = self.elements.applying(difference) else { return nil } let result = OrderedSet(array) return result.count == array.count ? result : nil } } -