mirror of
https://github.com/NixOS/nix
synced 2025-06-25 06:31:14 +02:00
Simplify PosIdx::hash()
In C++ we don't need to salt the hash.
This commit is contained in:
parent
d0e9878389
commit
f5ebaea277
1 changed files with 2 additions and 5 deletions
|
@ -1,8 +1,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
#include <functional>
|
||||||
#include "std-hash.hh"
|
|
||||||
|
|
||||||
namespace nix {
|
namespace nix {
|
||||||
|
|
||||||
|
@ -43,9 +42,7 @@ public:
|
||||||
|
|
||||||
size_t hash() const noexcept
|
size_t hash() const noexcept
|
||||||
{
|
{
|
||||||
size_t h = 854125;
|
return std::hash<uint32_t>{}(id);
|
||||||
hash_combine(h, id);
|
|
||||||
return h;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue