7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-11 16:10:10 +00:00

KIID: Use Boost uuids own hash function (fix Boost 1.86)

Not only is this simpler, but it should be compatible
with all Boost versions (the cast is a problem in 1.86)
and it was also 'improved' in 1.86 for better mixing.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18651
This commit is contained in:
John Beard 2024-09-07 16:13:42 +01:00
parent aceca713d8
commit 9a3ebfba40

View File

@ -28,7 +28,6 @@
#include <boost/random/mersenne_twister.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <boost/functional/hash.hpp>
#if BOOST_VERSION >= 106700
#include <boost/uuid/entropy_error.hpp>
@ -226,15 +225,7 @@ timestamp_t KIID::AsLegacyTimestamp() const
size_t KIID::Hash() const
{
size_t hash = 0;
// Note: this is NOT little-endian/big-endian safe, but as long as it's just used
// at runtime it won't matter.
for( int i = 0; i < 4; ++i )
boost::hash_combine( hash, reinterpret_cast<const uint32_t*>( m_uuid.data )[i] );
return hash;
return boost::uuids::hash_value( m_uuid );
}