• R/O
  • HTTP
  • SSH
  • HTTPS

KCD: Commit

main code repository.


Commit MetaInfo

Revisiond308b72f9032f10ba439e728c81d4e30db035f33 (tree)
Time2017-10-14 21:54:45
Authormasakih <masakih@user...>
Commitermasakih

Log Message

verをletに変更

Change Summary

Incremental Difference

--- a/KCD/DefaultSettings.swift
+++ b/KCD/DefaultSettings.swift
@@ -189,7 +189,7 @@ extension DefaultKeys {
189189 static let defaults: [String: Any] = settings
190190 .flatMap { (k: DefaultKeys, v: Any?) -> (key: String, value: Any)? in
191191
192- guard var value = v else { return nil }
192+ guard let value = v else { return nil }
193193
194194 if isDefaultValuePrimitive(value) {
195195
--- a/KCD/ScreenshotListViewController.swift
+++ b/KCD/ScreenshotListViewController.swift
@@ -248,7 +248,7 @@ final class ScreenshotListViewController: NSViewController {
248248
249249 let imageTypes = NSImage.imageTypes
250250 let ws = NSWorkspace.shared
251- var current = screenshots.screenshots
251+ let current = screenshots.screenshots
252252 let newFiles: [URL] = f.flatMap {
253253
254254 guard let type = try? ws.type(ofFile: $0.path) else { return nil }
@@ -257,16 +257,16 @@ final class ScreenshotListViewController: NSViewController {
257257 }
258258
259259 // なくなっているものを削除
260- current = current.filter { newFiles.contains($0.url) }
260+ let itemWithoutDeleting = current.filter { newFiles.contains($0.url) }
261261
262262 // 新しいものを追加
263263 let new: [ScreenshotInformation] = newFiles.flatMap { url in
264264
265- if current.contains(where: { url == $0.url }) { return nil }
265+ if itemWithoutDeleting.contains(where: { url == $0.url }) { return nil }
266266 return ScreenshotInformation(url: url)
267267 }
268268
269- screenshots.screenshots = current + new
269+ screenshots.screenshots = itemWithoutDeleting + new
270270
271271 collectionView.selectionIndexPaths = [NSIndexPath(forItem: 0, inSection: 0) as IndexPath]
272272
Show on old repository browser