diff options
author | Tim Schumacher <timschumi@gmx.de> | 2023-01-30 11:03:45 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-08 17:44:32 +0000 |
commit | fa09152e233495944f0bbafdc6be88e2f9995782 (patch) | |
tree | c11d6d727d3ff611b720407da49defd79e3d5ae0 /AK | |
parent | 839bec14af2d50e653142556d3e0652a397cbc09 (diff) | |
download | serenity-fa09152e233495944f0bbafdc6be88e2f9995782.zip |
AK: Remove the fallible constructor from `BigEndianInputBitStream`
Diffstat (limited to 'AK')
-rw-r--r-- | AK/BitStream.h | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/AK/BitStream.h b/AK/BitStream.h index 922e86da17..4cd2023e71 100644 --- a/AK/BitStream.h +++ b/AK/BitStream.h @@ -17,9 +17,9 @@ namespace AK { /// in big-endian order from another stream. class BigEndianInputBitStream : public Stream { public: - static ErrorOr<NonnullOwnPtr<BigEndianInputBitStream>> construct(MaybeOwned<Stream> stream) + explicit BigEndianInputBitStream(MaybeOwned<Stream> stream) + : m_stream(move(stream)) { - return adopt_nonnull_own_or_enomem<BigEndianInputBitStream>(new BigEndianInputBitStream(move(stream))); } // ^Stream @@ -112,11 +112,6 @@ public: ALWAYS_INLINE bool is_aligned_to_byte_boundary() const { return m_bit_offset == 0; } private: - BigEndianInputBitStream(MaybeOwned<Stream> stream) - : m_stream(move(stream)) - { - } - Optional<u8> m_current_byte; size_t m_bit_offset { 0 }; MaybeOwned<Stream> m_stream; |