Skip to content

Commit

Permalink
Simplify PosIdx::hash()
Browse files Browse the repository at this point in the history
In C++ we don't need to salt the hash.
  • Loading branch information
roberth committed Jul 17, 2024
1 parent d0e9878 commit f5ebaea
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/libexpr/pos-idx.hh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#pragma once

#include <cinttypes>

#include "std-hash.hh"
#include <functional>

namespace nix {

Expand Down Expand Up @@ -43,9 +42,7 @@ public:

size_t hash() const noexcept
{
size_t h = 854125;
hash_combine(h, id);
return h;
return std::hash<uint32_t>{}(id);
}
};

Expand Down

0 comments on commit f5ebaea

Please sign in to comment.