Skip to content

Commit 13446e4

Browse files
authored
Tweak the comment to cover how to "hook" Hashable.
1 parent 94637a2 commit 13446e4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Sources/SwiftProtobuf/HashVisitor.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ import Foundation
1818
private let i_2166136261 = Int(bitPattern: 2166136261)
1919
private let i_16777619 = Int(16777619)
2020

21-
/// Computes the hash value of a message by visiting its fields recursively.
21+
/// Computes the hash of a message by visiting its fields recursively.
2222
///
2323
/// Note that because this visits every field, it has the potential to be slow
2424
/// for large or deeply nested messages. Users who need to use such messages as
25-
/// dictionary keys or set members should override `hashValue` in an extension
26-
/// and provide a more efficient implementation by examining only a subset of
27-
/// key fields.
25+
/// dictionary keys or set members can use a wrapper struct around the message
26+
/// and use a custom Hashable implementation that looks at the subset of the
27+
/// message fields they want to include.
2828
internal struct HashVisitor: Visitor {
2929

3030
// Roughly based on FNV hash: http://tools.ietf.org/html/draft-eastlake-fnv-03

0 commit comments

Comments
 (0)