Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed needless Array initialization #212

Merged
merged 3 commits into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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://github.com/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