mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-09-28 23:03:15 +02:00
Use ReadLE64 in uint256::GetUint64() instead of duplicating logic
This commit is contained in:
@@ -6,6 +6,7 @@
|
|||||||
#ifndef BITCOIN_UINT256_H
|
#ifndef BITCOIN_UINT256_H
|
||||||
#define BITCOIN_UINT256_H
|
#define BITCOIN_UINT256_H
|
||||||
|
|
||||||
|
#include <crypto/common.h>
|
||||||
#include <span.h>
|
#include <span.h>
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@@ -84,15 +85,7 @@ public:
|
|||||||
|
|
||||||
uint64_t GetUint64(int pos) const
|
uint64_t GetUint64(int pos) const
|
||||||
{
|
{
|
||||||
const uint8_t* ptr = m_data + pos * 8;
|
return ReadLE64(m_data + pos * 8);
|
||||||
return ((uint64_t)ptr[0]) | \
|
|
||||||
((uint64_t)ptr[1]) << 8 | \
|
|
||||||
((uint64_t)ptr[2]) << 16 | \
|
|
||||||
((uint64_t)ptr[3]) << 24 | \
|
|
||||||
((uint64_t)ptr[4]) << 32 | \
|
|
||||||
((uint64_t)ptr[5]) << 40 | \
|
|
||||||
((uint64_t)ptr[6]) << 48 | \
|
|
||||||
((uint64_t)ptr[7]) << 56;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename Stream>
|
template<typename Stream>
|
||||||
|
Reference in New Issue
Block a user