mirror of
https://github.com/mas-cli/mas
synced 2024-11-22 03:23:08 +00:00
♻️ Simplify max length calculation
This commit is contained in:
parent
e7fbcffbab
commit
2e498380ce
1 changed files with 1 additions and 4 deletions
|
@ -16,10 +16,7 @@ struct SearchResultFormatter {
|
|||
/// - Returns: Multiliune text outoutp.
|
||||
static func format(results: [SearchResult], includePrice: Bool = false) -> String {
|
||||
// find longest appName for formatting, default 50
|
||||
let maxLength =
|
||||
results.map(\.trackName).max(by: { $1.count > $0.count })?.count
|
||||
?? 50
|
||||
|
||||
let maxLength = results.map(\.trackName.count).max() ?? 50
|
||||
var output: String = ""
|
||||
|
||||
for result in results {
|
||||
|
|
Loading…
Reference in a new issue