Skip to content

Commit caacb0e

Browse files
authored
Merge pull request #1106 from bubski/warnings
2 parents 31d1d41 + 378e4a7 commit caacb0e

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Foundation/Data.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1514,7 +1514,6 @@ public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessColl
15141514
@inline(__always)
15151515
public func subdata(in range: Range<Index>) -> Data {
15161516
_validateRange(range)
1517-
let length = count
15181517
if count == 0 {
15191518
return Data()
15201519
}

TestFoundation/HTTPServer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ class _TCPSocket {
106106
}
107107

108108
func writeRawData(_ data: Data) throws {
109-
let x = try data.withUnsafeBytes { ptr in
109+
_ = try data.withUnsafeBytes { ptr in
110110
try attempt("write", valid: isNotNegative, CInt(write(connectionSocket, ptr, data.count)))
111111
}
112112
}

TestFoundation/TestNSIndexPath.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,10 @@ class TestNSIndexPath: XCTestCase {
277277
let ip2: IndexPath = [1, 1, 1]
278278

279279
XCTAssertNotEqual(ip1.hashValue, ip2.hashValue)
280-
281-
IndexPath(indexes: [Int.max >> 8, 2, Int.max >> 36]).hashValue // this should not cause an overflow crash
280+
281+
// this should not cause an overflow crash
282+
let hash: Int? = IndexPath(indexes: [Int.max >> 8, 2, Int.max >> 36]).hashValue
283+
XCTAssertNotNil(hash)
282284
}
283285

284286
func testEquality() {

0 commit comments

Comments
 (0)