summaryrefslogtreecommitdiff
path: root/AK/BitStream.h
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2023-01-30 11:05:12 +0100
committerLinus Groh <mail@linusgroh.de>2023-02-08 17:44:32 +0000
commit8b2f23d0166ec9d21a70f10dadb2d7533a161079 (patch)
tree978ce57b7202bd63331635e083332b482dac71cb /AK/BitStream.h
parent0fee97916b5471cd42e6c00f2809476eeacc6d73 (diff)
downloadserenity-8b2f23d0166ec9d21a70f10dadb2d7533a161079.zip
AK: Remove the fallible constructor from `LittleEndianOutputBitStream`
Diffstat (limited to 'AK/BitStream.h')
-rw-r--r--AK/BitStream.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/AK/BitStream.h b/AK/BitStream.h
index 310217e0e1..c5a3d89801 100644
--- a/AK/BitStream.h
+++ b/AK/BitStream.h
@@ -303,9 +303,9 @@ private:
/// in little-endian order to another stream.
class LittleEndianOutputBitStream : public Stream {
public:
- static ErrorOr<NonnullOwnPtr<LittleEndianOutputBitStream>> construct(MaybeOwned<Stream> stream)
+ explicit LittleEndianOutputBitStream(MaybeOwned<Stream> stream)
+ : m_stream(move(stream))
{
- return adopt_nonnull_own_or_enomem<LittleEndianOutputBitStream>(new LittleEndianOutputBitStream(move(stream)));
}
virtual ErrorOr<Bytes> read(Bytes) override
@@ -372,11 +372,6 @@ public:
}
private:
- LittleEndianOutputBitStream(MaybeOwned<Stream> stream)
- : m_stream(move(stream))
- {
- }
-
MaybeOwned<Stream> m_stream;
u8 m_current_byte { 0 };
size_t m_bit_offset { 0 };