summaryrefslogtreecommitdiff
path: root/Sora/Extensions
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-07-05 06:36:16 -0700
committerFuwn <[email protected]>2025-07-05 06:36:16 -0700
commitfcf9ea89cf9190d4deb1e8e7223bf32a1f03b44f (patch)
treecaf89e739b6ce730eb2ff0f0ef060c00cb4f15e9 /Sora/Extensions
parentfeat: Development commit (diff)
downloadsora-testing-fcf9ea89cf9190d4deb1e8e7223bf32a1f03b44f.tar.xz
sora-testing-fcf9ea89cf9190d4deb1e8e7223bf32a1f03b44f.zip
feat: Development commit
Diffstat (limited to 'Sora/Extensions')
-rw-r--r--Sora/Extensions/Array+RemovingDuplicates.swift9
1 files changed, 9 insertions, 0 deletions
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<Element>()
+
+ return filter { seen.insert($0).inserted }
+ }
+}