Skip to content

Commit f07b8e1

Browse files
committed
[Foundation] URL: Add hash(into:) implementation
Note: URL does not implement Hashable.
1 parent 562b6ec commit f07b8e1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Darwin/Foundation-swiftoverlay/URL.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,10 +622,14 @@ public struct URL : ReferenceConvertible, Equatable {
622622
_url = URL._converted(from: NSURL(fileURLWithFileSystemRepresentation: path, isDirectory: isDirectory, relativeTo: baseURL))
623623
}
624624

625-
public var hashValue: Int {
625+
public var hashValue: Int { // FIXME(hashValue): This should be removed once URL implements Hashable.
626626
return _url.hash
627627
}
628-
628+
629+
public func hash(into hasher: inout Hasher) {
630+
hasher.combine(_url)
631+
}
632+
629633
// MARK: -
630634

631635
/// Returns the data representation of the URL's relativeString.

0 commit comments

Comments
 (0)