Skip to content

Commit 9055e7c

Browse files
authored
Remove unneeded compiler guard. (#35)
Motivation: We no longer support compilers older than 5.3 (or indeed older than 5.6), so we don't need compiler guards for old ones. Modifications: Remove fallback for old compilers. Result: Easier to understand code
1 parent ef88c22 commit 9055e7c

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

Sources/RawStructuredFieldValues/FieldParser.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,6 @@ extension String {
524524
// We assume the string is previously validated, so the escapes are easily removed. See the doc comment for
525525
// `StrippingStringEscapesCollection` for more details on what we're doing here.
526526
let unescapedBytes = StrippingStringEscapesCollection(bytes, escapes: escapes)
527-
#if canImport(Darwin)
528527
if #available(macOS 10.16, macCatalyst 10.16, iOS 14.0, watchOS 7.0, tvOS 14.0, *) {
529528
return String(unsafeUninitializedCapacity: unescapedBytes.count) { innerPtr in
530529
let (_, endIndex) = innerPtr.initialize(from: unescapedBytes)
@@ -533,16 +532,6 @@ extension String {
533532
} else {
534533
return String(decoding: unescapedBytes, as: UTF8.self)
535534
}
536-
#else
537-
#if compiler(>=5.3)
538-
return String(unsafeUninitializedCapacity: unescapedBytes.count) { innerPtr in
539-
let (_, endIndex) = innerPtr.initialize(from: unescapedBytes)
540-
return endIndex
541-
}
542-
#else
543-
return String(decoding: unescapedBytes, as: UTF8.self)
544-
#endif
545-
#endif
546535
}
547536
}
548537

0 commit comments

Comments
 (0)