1
0
Fork 0
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:
Eelco Dolstra 2024-07-15 15:46:30 +02:00
parent cdc23b67a6
commit 550b3479cf
2 changed files with 19 additions and 1 deletions

View file

@ -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;
}
};