Skip to content

Commit 236451e

Browse files
committed
Remove extraneous #if os checks when using JSONEncoder
1 parent b9698e7 commit 236451e

File tree

2 files changed

+0
-8
lines changed

2 files changed

+0
-8
lines changed

Sources/Commands/SwiftPackageTool.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,13 +285,9 @@ public class SwiftPackageTool: SwiftTool<PackageToolOptions> {
285285

286286
let encoder = JSONEncoder()
287287
encoder.userInfo[Manifest.dumpPackageKey] = true
288-
#if os(macOS)
289288
if #available(OSX 10.13, *) {
290289
encoder.outputFormatting = [.prettyPrinted, .sortedKeys]
291290
}
292-
#else
293-
encoder.outputFormatting = [.prettyPrinted, .sortedKeys]
294-
#endif
295291

296292
let jsonData = try encoder.encode(manifest)
297293
let jsonString = String(data: jsonData, encoding: .utf8)!

Sources/SPMLLBuild/llbuild.swift

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,9 @@ private func fromBytes<T: Decodable>(_ bytes: [UInt8]) throws -> T {
198198

199199
private func toBytes<T: Encodable>(_ value: T) throws -> [UInt8] {
200200
let encoder = JSONEncoder()
201-
#if os(macOS)
202201
if #available(OSX 10.13, *) {
203202
encoder.outputFormatting = [.sortedKeys]
204203
}
205-
#else
206-
encoder.outputFormatting = [.sortedKeys]
207-
#endif
208204
let encoded = try encoder.encode(value)
209205
return [UInt8](encoded)
210206
}

0 commit comments

Comments
 (0)