Attempt to fix clang CI error

This commit is contained in:
John Wellbelove 2022-09-11 19:50:09 +01:00
parent 11c520fbaf
commit e99a1a5845
2 changed files with 23 additions and 25 deletions

View File

@ -158,16 +158,16 @@ namespace etl
value_type key_value_pair;
};
//friend bool operator ==(const node_t& lhs, const node_t& rhs)
//{
// return (lhs.key_value_pair.first == rhs.key_value_pair.first) &&
// (lhs.key_value_pair.second == rhs.key_value_pair.second);
//}
friend bool operator ==(const node_t& lhs, const node_t& rhs)
{
return (lhs.key_value_pair.first == rhs.key_value_pair.first) &&
(lhs.key_value_pair.second == rhs.key_value_pair.second);
}
//friend bool operator !=(const node_t& lhs, const node_t& rhs)
//{
// return !(lhs == rhs);
//}
friend bool operator !=(const node_t& lhs, const node_t& rhs)
{
return !(lhs == rhs);
}
protected:
@ -1512,23 +1512,21 @@ namespace etl
template <typename TKey, typename T, typename TKeyCompare>
bool operator ==(const etl::iunordered_map<TKey, T, TKeyCompare>& lhs, const etl::iunordered_map<TKey, T, TKeyCompare>& rhs)
{
return (lhs.size() == rhs.size()) && etl::equal(lhs.begin(), lhs.end(), rhs.begin());
const bool sizes_match = (lhs.size() == rhs.size());
bool elements_match = true;
//const bool sizes_match = (lhs.size() == rhs.size());
//bool elements_match = true;
if (sizes_match)
{
for (size_t i = 0; (i < lhs.bucket_count()) && elements_match; ++i)
{
if (!etl::is_permutation(lhs.begin(i), lhs.end(i), rhs.begin(i)))
{
elements_match = false;
}
}
}
//if (sizes_match)
//{
// for (size_t i = 0; (i < lhs.bucket_count()) && elements_match; ++i)
// {
// if (!etl::is_permutation(lhs.begin(i), lhs.end(i), rhs.begin(i)))
// {
// elements_match = false;
// }
// }
//}
//return (sizes_match && elements_match);
return (sizes_match && elements_match);
}
//***************************************************************************

View File

@ -50,7 +50,7 @@ namespace
char* begin = (char*)&storage[0];
strcpy(begin, data.c_str());
uint32_t hash = etl::murmur3<uint32_t>(begin, begin + 10);
uint32_t hash = etl::murmur3<uint32_t>(begin, begin + data.size());
uint32_t compare;
MurmurHash3_x86_32(begin, data.size(), 0, &compare);