Skip to content

Commit

Permalink
review: condense categorizedAvailability initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
QuietMisdreavus committed Dec 22, 2022
1 parent 4838eb6 commit 8c03891
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Sources/SwiftDocC/Semantics/Metadata/Metadata.swift
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,7 @@ public final class Metadata: Semantic, AutomaticDirectiveConvertible {
}
}

var categorizedAvailability = [MetadataAvailability.Platform : [MetadataAvailability]]()
for availability in availability {
categorizedAvailability[availability.platform, default: []].append(availability)
}
let categorizedAvailability = Dictionary(grouping: availability, by: \.platform)

for availabilityAttrs in categorizedAvailability.values {
guard availabilityAttrs.count > 1 else {
Expand Down

0 comments on commit 8c03891

Please sign in to comment.