File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
src/libutil/include/nix/util Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -119,15 +119,23 @@ struct SourcePath
119119
120120std::ostream & operator <<(std::ostream & str, const SourcePath & path);
121121
122+ inline std::size_t hash_value (const SourcePath & path)
123+ {
124+ std::size_t hash = 0 ;
125+ boost::hash_combine (hash, path.accessor ->number );
126+ boost::hash_combine (hash, path.path );
127+ return hash;
128+ }
129+
122130} // namespace nix
123131
124132template <>
125133struct std ::hash<nix::SourcePath>
126134{
135+ using is_avalanching = std::true_type;
136+
127137 std::size_t operator ()(const nix::SourcePath & s) const noexcept
128138 {
129- std::size_t hash = 0 ;
130- hash_combine (hash, s.accessor ->number , s.path );
131- return hash;
139+ return nix::hash_value (s);
132140 }
133141};
You can’t perform that action at this time.
0 commit comments