From 65b37638828f0d13d8f67139b0bbf38e814a3841 Mon Sep 17 00:00:00 2001 From: Chris Araman Date: Tue, 27 Apr 2021 15:36:13 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Prefer=20isEmpty=20to=20equality?= =?UTF-8?q?=20check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/MasKit/Commands/SignIn.swift | 2 +- Sources/MasKit/Models/SoftwareProduct.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/MasKit/Commands/SignIn.swift b/Sources/MasKit/Commands/SignIn.swift index bb595f4b4..77fc12810 100644 --- a/Sources/MasKit/Commands/SignIn.swift +++ b/Sources/MasKit/Commands/SignIn.swift @@ -31,7 +31,7 @@ public struct SignInCommand: CommandProtocol { printInfo("Signing in to Apple ID: \(options.username)") let password: String = { - if options.password == "", !options.dialog { + if options.password.isEmpty, !options.dialog { return String(validatingUTF8: getpass("Password: "))! } return options.password diff --git a/Sources/MasKit/Models/SoftwareProduct.swift b/Sources/MasKit/Models/SoftwareProduct.swift index bf6afd047..6c5d129ba 100644 --- a/Sources/MasKit/Models/SoftwareProduct.swift +++ b/Sources/MasKit/Models/SoftwareProduct.swift @@ -30,7 +30,7 @@ extension SoftwareProduct { /// Returns bundleIdentifier if appName is empty string. var appNameOrBundleIdentifier: String { - appName == "" ? bundleIdentifier : appName + appName.isEmpty ? bundleIdentifier : appName } func isOutdatedWhenComparedTo(_ storeApp: SearchResult) -> Bool {