From e8891e6d56fe001c92a3981f59e747283238a02f Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Sun, 10 Oct 2021 01:40:53 +0330 Subject: [PATCH] LibTLS: Remove useless ByteBuffer allocation in TLSv12::read_line() --- Userland/Libraries/LibTLS/Socket.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Userland/Libraries/LibTLS/Socket.cpp b/Userland/Libraries/LibTLS/Socket.cpp index 3f3aa3c0e8..0005b6cce0 100644 --- a/Userland/Libraries/LibTLS/Socket.cpp +++ b/Userland/Libraries/LibTLS/Socket.cpp @@ -51,14 +51,6 @@ String TLSv12::read_line(size_t max_size) if (offset > max_size) return {}; - auto buffer_result = ByteBuffer::copy(start, offset); - if (!buffer_result.has_value()) { - dbgln("TLS: Failed to read line, not enough memory"); - dbgln("max_size < offset: {} < {} (size = {})", max_size, offset, m_context.application_buffer.size()); - dbgln("-> {:32hex-dump}", ReadonlyBytes { start, offset }); - return {}; - } - String line { bit_cast(start), offset, Chomp }; m_context.application_buffer = m_context.application_buffer.slice(offset + 1, m_context.application_buffer.size() - offset - 1);