Skip to content

Commit

Permalink
Merge pull request #212 from RomanPodymov/master
Browse files Browse the repository at this point in the history
Removed needless `Array` initialization
  • Loading branch information
yonaskolb authored Jan 8, 2020
2 parents 72beb6f + d5e0189 commit 72cc878
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
- Fixed `'??' has non-optional type` warning #207
- Fixed incorrect replacements in server variables #209

### Internal
- Removed needless `Array` initialization. [#212](https:/yonaskolb/SwagGen/pull/212) @RomanPodymov

## 4.3.0

### Added
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwagGenKit/Generator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ public class Generator {

let cleanFilesSet = Set(cleanFiles)
let generatedFilesSet = Set(generatedFiles.map { destination + $0.path })
let removedFiles = Array(cleanFilesSet.subtracting(generatedFilesSet)).sorted()
let removedFiles = cleanFilesSet.subtracting(generatedFilesSet).sorted()

for file in generatedFiles {
let outputPath = (destination + file.path).normalize()
Expand Down
2 changes: 1 addition & 1 deletion Sources/Swagger/SwaggerSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public struct SwaggerSpec {

public var tags: [String] {
let tags: [String] = operations.reduce([]) { $0 + $1.tags }
let distinctTags = Array(Set(tags))
let distinctTags = Set(tags)
return distinctTags.sorted { $0.compare($1) == .orderedAscending }
}
}
Expand Down

0 comments on commit 72cc878

Please sign in to comment.