mirror of
https://github.com/NixOS/nix
synced 2025-06-25 19:01:16 +02:00
Include the accessor in the SourcePath hash
This commit is contained in:
parent
cdc23b67a6
commit
550b3479cf
2 changed files with 19 additions and 1 deletions
|
@ -9,6 +9,8 @@
|
|||
#include "canon-path.hh"
|
||||
#include "source-accessor.hh"
|
||||
|
||||
#include <boost/functional/hash.hpp> // for boost::hash_combine
|
||||
|
||||
namespace nix {
|
||||
|
||||
/**
|
||||
|
@ -128,6 +130,8 @@ struct std::hash<nix::SourcePath>
|
|||
{
|
||||
std::size_t operator()(const nix::SourcePath & s) const noexcept
|
||||
{
|
||||
return std::hash<decltype(s.path)>{}(s.path);
|
||||
std::size_t hash = 0;
|
||||
hash_combine(hash, s.accessor->number, s.path);
|
||||
return hash;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue