Improve parameter names.

Partial #592

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
This commit is contained in:
Ross Goldberg 2024-10-21 07:42:30 -04:00
parent 586de07389
commit 2af2a42a88
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View file

@ -58,14 +58,14 @@ extension Mas {
let apps: [SoftwareProduct] =
appIDs.isEmpty
? appLibrary.installedApps
: appIDs.compactMap {
if let appID = AppID($0) {
: appIDs.compactMap { appID in
if let appID = AppID(appID) {
// argument is an AppID, lookup app by id using argument
return appLibrary.installedApp(withAppID: appID)
}
// argument is not an AppID, lookup app by name using argument
return appLibrary.installedApp(named: $0)
return appLibrary.installedApp(named: appID)
}
let promises = apps.map { installedApp in

View file

@ -36,7 +36,7 @@ class MasStoreSearch: StoreSearch {
///
/// - Parameter searchTerm: a search term matched against app names
/// - Returns: A Promise of an Array of SearchResults matching searchTerm
func search(for appName: String) -> Promise<[SearchResult]> {
func search(for searchTerm: String) -> Promise<[SearchResult]> {
// Search for apps for compatible platforms, in order of preference.
// Macs with Apple Silicon can run iPad and iPhone apps.
var entities = [Entity.desktopSoftware]
@ -45,8 +45,8 @@ class MasStoreSearch: StoreSearch {
}
let results = entities.map { entity in
guard let url = searchURL(for: appName, inCountry: country, ofEntity: entity) else {
fatalError("Failed to build URL for \(appName)")
guard let url = searchURL(for: searchTerm, inCountry: country, ofEntity: entity) else {
fatalError("Failed to build URL for \(searchTerm)")
}
return loadSearchResults(url)
}