Optimize URL creation.

This commit is contained in:
Damiano Galassi committed 2019-04-20 10:51:57 +02:00
1 parent d6bed38d82
commit ca9b4ed836
1 file changed
+1 -1
+1 -1
View File
@@ -178,7 +178,7 @@ final class OptionsViewController: NSViewController, NSMenuItemValidation {
private func loadRecentDestinations() {
if let loadedDestinations = UserDefaults.standard.array(forKey: "SBQueueRecentDestinations") as? [String] {
recentDestinations = loadedDestinations.compactMap { URL(fileURLWithPath: $0) }
recentDestinations = loadedDestinations.compactMap { URL(fileURLWithPath: $0, isDirectory: true) }
if recentDestinations.count > 6 {
recentDestinations = Array(recentDestinations[0..<6])
}