diff --git a/AK/BitStream.h b/AK/BitStream.h index 3c7ef8ba0b..df7bdd1f5f 100644 --- a/AK/BitStream.h +++ b/AK/BitStream.h @@ -120,6 +120,15 @@ private: /// A stream wrapper class that allows you to read arbitrary amounts of bits /// in little-endian order from another stream. class LittleEndianInputBitStream : public Stream { + template + static constexpr T lsb_mask(T bits) + { + constexpr auto max = NumericLimits::max(); + constexpr auto digits = NumericLimits::digits(); + + return bits == 0 ? 0 : max >> (digits - bits); + } + public: explicit LittleEndianInputBitStream(MaybeOwned stream) : m_stream(move(stream)) @@ -214,15 +223,6 @@ public: private: using BufferType = u64; - template - static constexpr T lsb_mask(T bits) - { - constexpr auto max = NumericLimits::max(); - constexpr auto digits = NumericLimits::digits(); - - return bits == 0 ? 0 : max >> (digits - bits); - } - ALWAYS_INLINE BufferType lsb_aligned_buffer() const { return m_bit_offset == bit_buffer_size ? 0 : m_bit_buffer >> m_bit_offset;