mirror of
https://github.com/monero-project/monero.git
synced 2024-11-18 00:37:43 +00:00
parent
a7310031f4
commit
f5affbef26
1 changed files with 6 additions and 0 deletions
|
@ -149,8 +149,14 @@ private:
|
||||||
|
|
||||||
int compare_uint64(const MDB_val *a, const MDB_val *b)
|
int compare_uint64(const MDB_val *a, const MDB_val *b)
|
||||||
{
|
{
|
||||||
|
#ifdef MISALIGNED_OK
|
||||||
const uint64_t va = *(const uint64_t*)a->mv_data;
|
const uint64_t va = *(const uint64_t*)a->mv_data;
|
||||||
const uint64_t vb = *(const uint64_t*)b->mv_data;
|
const uint64_t vb = *(const uint64_t*)b->mv_data;
|
||||||
|
#else
|
||||||
|
uint64_t va, vb;
|
||||||
|
memcpy(&va, a->mv_data, sizeof(uint64_t));
|
||||||
|
memcpy(&vb, b->mv_data, sizeof(uint64_t));
|
||||||
|
#endif
|
||||||
if (va < vb) return -1;
|
if (va < vb) return -1;
|
||||||
else if (va == vb) return 0;
|
else if (va == vb) return 0;
|
||||||
else return 1;
|
else return 1;
|
||||||
|
|
Loading…
Reference in a new issue