Use multiprecision::msb() in GasMeter and remove FixedHash dependency

This commit is contained in:
Alex Beregszaszi
2020-01-17 14:24:55 +01:00
committed by Daniel Kirchner
parent 3a17ca6331
commit 00f3c42d17
2 changed files with 8 additions and 19 deletions
-16
View File
@@ -104,22 +104,6 @@ public:
/// @returns a copy of the object's data as a byte vector.
bytes asBytes() const { return bytes(data(), data() + N); }
/// Returns the index of the first bit set to one, or size() * 8 if no bits are set.
inline unsigned firstBitSet() const
{
unsigned ret = 0;
for (auto d: m_data)
if (d)
{
for (;; ++ret, d <<= 1)
if (d & 0x80)
return ret;
}
else
ret += 8;
return ret;
}
private:
std::array<uint8_t, N> m_data; ///< The binary data.
};