Skip to content

Commit d69e6a6

Browse files
committed
Drop support for swift language version 4.0
1 parent 618ec18 commit d69e6a6

File tree

3 files changed

+2
-29
lines changed

3 files changed

+2
-29
lines changed

Package.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:4.0
1+
// swift-tools-version:4.2
22

33
/*
44
This source file is part of the Swift.org open source project
@@ -239,7 +239,7 @@ let package = Package(
239239
name: "XcodeprojTests",
240240
dependencies: ["Xcodeproj", "TestSupport"]),
241241
],
242-
swiftLanguageVersions: [4]
242+
swiftLanguageVersions: [.v4_2]
243243
)
244244

245245
// Add package dependency on llbuild when not bootstrapping.

Sources/Basic/ByteString.swift

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,6 @@ extension ByteString: CustomStringConvertible {
9090
}
9191
}
9292

93-
#if !swift(>=4.2)
94-
extension ByteString {
95-
public var hashValue: Int {
96-
var result = contents.count
97-
for byte in contents {
98-
result = result &* 31 &+ Int(byte)
99-
}
100-
return result
101-
}
102-
}
103-
#endif
104-
10593
/// ByteStreamable conformance for a ByteString.
10694
extension ByteString: ByteStreamable {
10795
public func write(to stream: OutputByteStream) {

Sources/Utility/Version.swift

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,6 @@ public struct Version: Hashable {
4545
}
4646
}
4747

48-
#if !swift(>=4.2)
49-
extension Version {
50-
public var hashValue: Int {
51-
let mul: UInt64 = 0x9ddfea08eb382d69
52-
var result: UInt64 = 0
53-
result = (result &* mul) ^ UInt64(bitPattern: Int64(major.hashValue))
54-
result = (result &* mul) ^ UInt64(bitPattern: Int64(minor.hashValue))
55-
result = (result &* mul) ^ UInt64(bitPattern: Int64(patch.hashValue))
56-
result = prereleaseIdentifiers.reduce(result, { ($0 &* mul) ^ UInt64(bitPattern: Int64($1.hashValue)) })
57-
result = buildMetadataIdentifiers.reduce(result, { ($0 &* mul) ^ UInt64(bitPattern: Int64($1.hashValue)) })
58-
return Int(truncatingIfNeeded: result)
59-
}
60-
}
61-
#endif
62-
6348
extension Version: Comparable {
6449

6550
func isEqualWithoutPrerelease(_ other: Version) -> Bool {

0 commit comments

Comments
 (0)