• R/O
  • HTTP
  • SSH
  • HTTPS

KCD: Commit

main code repository.


Commit MetaInfo

Revision3f4558a82d331699f2de5bdb97576e658eb2bce4 (tree)
Time2018-08-12 17:24:54
Authormasakih <masakih@user...>
Commitermasakih

Log Message

Sequenceのextensionを分離

Change Summary

Incremental Difference

--- a/KCD.xcodeproj/project.pbxproj
+++ b/KCD.xcodeproj/project.pbxproj
@@ -31,6 +31,7 @@
3131 F421850A1DF44AA900256590 /* AirBaseWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = F421850C1DF44AA900256590 /* AirBaseWindowController.xib */; };
3232 F421850F1DF4518000256590 /* BroswerTouchBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = F421850E1DF4518000256590 /* BroswerTouchBar.xib */; };
3333 F42185111DF461A600256590 /* ScreenshotTouchBar.xib in Resources */ = {isa = PBXBuildFile; fileRef = F42185101DF461A600256590 /* ScreenshotTouchBar.xib */; };
34+ F421D46B2116A083006F33E0 /* SequenceExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F421D46A2116A083006F33E0 /* SequenceExtensions.swift */; };
3435 F422D64C1FED474100183199 /* EnhancementListItemDownloader.swift in Sources */ = {isa = PBXBuildFile; fileRef = F422D64B1FED474100183199 /* EnhancementListItemDownloader.swift */; };
3536 F422D64E1FEE14D500183199 /* ViewAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = F422D64D1FEE14D500183199 /* ViewAnimation.swift */; };
3637 F422D6521FEF584100183199 /* SakutekiTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F422D6511FEF584100183199 /* SakutekiTest.swift */; };
@@ -415,6 +416,7 @@
415416 F421850D1DF44AEA00256590 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/AirBaseWindowController.xib; sourceTree = "<group>"; };
416417 F421850E1DF4518000256590 /* BroswerTouchBar.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BroswerTouchBar.xib; sourceTree = "<group>"; };
417418 F42185101DF461A600256590 /* ScreenshotTouchBar.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ScreenshotTouchBar.xib; sourceTree = "<group>"; };
419+ F421D46A2116A083006F33E0 /* SequenceExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SequenceExtensions.swift; sourceTree = "<group>"; };
418420 F422D64B1FED474100183199 /* EnhancementListItemDownloader.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnhancementListItemDownloader.swift; sourceTree = "<group>"; };
419421 F422D64D1FEE14D500183199 /* ViewAnimation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewAnimation.swift; sourceTree = "<group>"; };
420422 F422D6511FEF584100183199 /* SakutekiTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SakutekiTest.swift; sourceTree = "<group>"; };
@@ -810,6 +812,7 @@
810812 F455DDC01FA4A6CD00CDE64D /* Logger.swift */,
811813 F455DDC21FA4A9E400CDE64D /* LoggerExtension.swift */,
812814 F40F976E1E67092600AE81BB /* ArrayExtensions.swift */,
815+ F421D46A2116A083006F33E0 /* SequenceExtensions.swift */,
813816 F404AF561F2CDD1C00A006B8 /* DefaultKey.swift */,
814817 F404AF611F2D8CAE00A006B8 /* DefaultKeys.swift */,
815818 F48883461F2E2E9A0069E0C3 /* DefaultKeyExtendedValues.swift */,
@@ -1675,6 +1678,7 @@
16751678 F44BC71B1E29DCB4004644E3 /* MemberKDockCommand.swift in Sources */,
16761679 F46FEA3F1F81285D00E2427C /* Localizable.swift in Sources */,
16771680 F4AC136F1E0963DB00851147 /* ProgressPanel.swift in Sources */,
1681+ F421D46B2116A083006F33E0 /* SequenceExtensions.swift in Sources */,
16781682 F481D63F1F9105CB007E2CBE /* Entities.swift in Sources */,
16791683 F4AA592A1E1D1387001667AF /* IgnoreZeroTransformer.swift in Sources */,
16801684 F4AC136D1E0802C000851147 /* PreferencePanelController.swift in Sources */,
--- a/KCD/ArrayExtensions.swift
+++ b/KCD/ArrayExtensions.swift
@@ -8,27 +8,6 @@
88
99 import Foundation
1010
11-// powered by http://stackoverflow.com/questions/40579554/how-to-display-unique-elements-of-an-array-using-swift
12-extension Sequence where Iterator.Element: Hashable {
13-
14- func unique() -> [Iterator.Element] {
15-
16- var alreadyAdded = Set<Iterator.Element>()
17-
18- return filter {
19-
20- if alreadyAdded.contains($0) {
21-
22- return false
23- }
24-
25- alreadyAdded.insert($0)
26-
27- return true
28- }
29- }
30-}
31-
3211 extension Array {
3312
3413 func appended(_ elem: () -> Element) -> Array {
--- /dev/null
+++ b/KCD/SequenceExtensions.swift
@@ -0,0 +1,40 @@
1+//
2+// SequenceExtensions.swift
3+// KCD
4+//
5+// Created by Hori,Masaki on 2018/08/05.
6+// Copyright © 2018年 Hori,Masaki. All rights reserved.
7+//
8+
9+import Foundation
10+
11+// powered by http://stackoverflow.com/questions/40579554/how-to-display-unique-elements-of-an-array-using-swift
12+extension Sequence where Element: Hashable {
13+
14+ func unique() -> [Element] {
15+
16+ var alreadyAdded = Set<Element>()
17+
18+ return filter {
19+
20+ if alreadyAdded.contains($0) {
21+
22+ return false
23+ }
24+
25+ alreadyAdded.insert($0)
26+
27+ return true
28+ }
29+ }
30+}
31+
32+extension Sequence {
33+
34+ func noneOp(_ f: (Self) -> Void) -> Self {
35+
36+ f(self)
37+
38+ return self
39+ }
40+}
Show on old repository browser