We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 22834d5 + a4c8289 commit cf6f008Copy full SHA for cf6f008
libraries/chain/include/eosio/chain/name.hpp
@@ -2,6 +2,7 @@
2
#include <string>
3
#include <fc/reflect/reflect.hpp>
4
#include <iosfwd>
5
+#include <byteswap.h>
6
7
namespace eosio::chain {
8
struct name;
@@ -179,9 +180,10 @@ namespace eosio::chain {
179
180
namespace std {
181
template<> struct hash<eosio::chain::name> : private hash<uint64_t> {
182
typedef eosio::chain::name argument_type;
- size_t operator()(const argument_type& name) const noexcept
183
- {
184
- return hash<uint64_t>::operator()(name.to_uint64_t());
+
+ size_t operator()(const argument_type& name) const noexcept {
185
+ static_assert(sizeof(size_t) == sizeof(uint64_t));
186
+ return bswap_64(name.to_uint64_t());
187
}
188
};
189
0 commit comments