summaryrefslogtreecommitdiff
path: root/AK/BufferStream.h
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2020-08-05 10:55:36 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-06 10:33:16 +0200
commitac9f6fd1f8e235039fa3416f6ed68d07cbbf896c (patch)
tree91845257f917eb9da3f6f1c7e69ca27b893e647c /AK/BufferStream.h
parent5bfa7749c35d79475e39ac41d11cdd72e5d0da19 (diff)
downloadserenity-ac9f6fd1f8e235039fa3416f6ed68d07cbbf896c.zip
LibDebug: Use InputMemoryStream instead of BufferStream.
This removes another call to ByteBuffer::wrap(const void*, size_t).
Diffstat (limited to 'AK/BufferStream.h')
-rw-r--r--AK/BufferStream.h44
1 files changed, 0 insertions, 44 deletions
diff --git a/AK/BufferStream.h b/AK/BufferStream.h
index b39b88339c..ca07dd102b 100644
--- a/AK/BufferStream.h
+++ b/AK/BufferStream.h
@@ -352,50 +352,6 @@ public:
return *this;
}
- // LEB128 is a variable-length encoding for integers
- BufferStream& read_LEB128_unsigned(size_t& result)
- {
- result = 0;
- size_t num_bytes = 0;
- while (true) {
- if (m_offset > m_buffer.size()) {
- m_read_failure = true;
- break;
- }
- const u8 byte = m_buffer[m_offset];
- result = (result) | (static_cast<size_t>(byte & ~(1 << 7)) << (num_bytes * 7));
- ++m_offset;
- if (!(byte & (1 << 7)))
- break;
- ++num_bytes;
- }
-
- return *this;
- }
-
- // LEB128 is a variable-length encoding for integers
- BufferStream& read_LEB128_signed(ssize_t& result)
- {
- result = 0;
- size_t num_bytes = 0;
- u8 byte = 0;
- do {
- if (m_offset > m_buffer.size()) {
- m_read_failure = true;
- break;
- }
- byte = m_buffer[m_offset];
- result = (result) | (static_cast<size_t>(byte & ~(1 << 7)) << (num_bytes * 7));
- ++m_offset;
- ++num_bytes;
- } while (byte & (1 << 7));
- if (num_bytes * 7 < sizeof(size_t) * 4 && (byte & 0x40)) {
- // sign extend
- result |= ((size_t)(-1) << (num_bytes * 7));
- }
- return *this;
- }
-
BufferStream& advance(size_t amount)
{
if (m_offset + amount > m_buffer.size()) {