summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibTLS/TLSPacketBuilder.h
diff options
context:
space:
mode:
authorGunnar Beutner <gbeutner@serenityos.org>2021-05-31 00:31:46 +0200
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-05-31 14:49:00 +0430
commit5f18cf75c5d660873f840512f2fe55d4e239e238 (patch)
treef980bd886c4369a237899cddaf16458416c6e1b9 /Userland/Libraries/LibTLS/TLSPacketBuilder.h
parentdc54a0fbd399923ca0c3db1ffd34c63158ecd7d5 (diff)
downloadserenity-5f18cf75c5d660873f840512f2fe55d4e239e238.zip
AK: Replace ByteBuffer::grow with resize()/ensure_capacity()
Previously ByteBuffer::grow() behaved like Vector<T>::resize(). However the function name was somewhat ambiguous - and so this patch updates ByteBuffer to behave more like Vector<T> by replacing grow() with resize() and adding an ensure_capacity() method. This also lets the user change the buffer's capacity without affecting the size which was not previously possible. Additionally this patch makes the capacity() method public (again).
Diffstat (limited to 'Userland/Libraries/LibTLS/TLSPacketBuilder.h')
-rw-r--r--Userland/Libraries/LibTLS/TLSPacketBuilder.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibTLS/TLSPacketBuilder.h b/Userland/Libraries/LibTLS/TLSPacketBuilder.h
index dfc6cf7394..955caa0492 100644
--- a/Userland/Libraries/LibTLS/TLSPacketBuilder.h
+++ b/Userland/Libraries/LibTLS/TLSPacketBuilder.h
@@ -75,7 +75,7 @@ public:
m_current_length += bytes;
if (m_packet_data.size() < m_current_length) {
- m_packet_data.grow(m_current_length);
+ m_packet_data.resize(m_current_length);
}
m_packet_data.overwrite(old_length, data, bytes);