From fcf9ea89cf9190d4deb1e8e7223bf32a1f03b44f Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sat, 5 Jul 2025 06:36:16 -0700 Subject: feat: Development commit --- Sora/Extensions/Array+RemovingDuplicates.swift | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Sora/Extensions/Array+RemovingDuplicates.swift (limited to 'Sora/Extensions/Array+RemovingDuplicates.swift') diff --git a/Sora/Extensions/Array+RemovingDuplicates.swift b/Sora/Extensions/Array+RemovingDuplicates.swift new file mode 100644 index 0000000..15fc697 --- /dev/null +++ b/Sora/Extensions/Array+RemovingDuplicates.swift @@ -0,0 +1,9 @@ +import Foundation + +extension Array where Element: Hashable { + func removingDuplicates() -> [Element] { + var seen = Set() + + return filter { seen.insert($0).inserted } + } +} -- cgit v1.2.3