Skip to content

Commit 2c1f5c1

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-next
2 parents 15d5fc5 + 06685bc commit 2c1f5c1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

stdlib/public/Darwin/Network/NWEndpoint.swift

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,7 @@ public struct IPv4Address: IPAddress, Hashable, CustomDebugStringConvertible {
215215
if rawValue.count != MemoryLayout<in_addr>.size {
216216
return nil
217217
}
218-
let v4 = rawValue.withUnsafeBytes { (ptr: UnsafePointer<in_addr>) -> in_addr in
219-
return ptr.pointee
220-
}
218+
let v4 = rawValue.withUnsafeBytes { $0.load(as: in_addr.self) }
221219
self.init(v4, interface)
222220
}
223221

@@ -381,9 +379,7 @@ public struct IPv6Address: IPAddress, Hashable, CustomDebugStringConvertible {
381379
if rawValue.count != MemoryLayout<in6_addr>.size {
382380
return nil
383381
}
384-
let v6 = rawValue.withUnsafeBytes { (ptr: UnsafePointer<in6_addr>) -> in6_addr in
385-
return ptr.pointee
386-
}
382+
let v6 = rawValue.withUnsafeBytes { $0.load(as: in6_addr.self) }
387383
self.init(v6, interface)
388384
}
389385

0 commit comments

Comments
 (0)