We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2df0080 commit 1643e74Copy full SHA for 1643e74
src/libutil/include/nix/util/source-path.hh
@@ -119,15 +119,21 @@ struct SourcePath
119
120
std::ostream & operator<<(std::ostream & str, const SourcePath & path);
121
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
+
130
} // namespace nix
131
132
template<>
133
struct std::hash<nix::SourcePath>
134
{
135
std::size_t operator()(const nix::SourcePath & s) const noexcept
136
- std::size_t hash = 0;
- hash_combine(hash, s.accessor->number, s.path);
- return hash;
137
+ return nix::hash_value(s);
138
}
139
};
0 commit comments