From 19b710951f40fdc4292d840cc9586c0d9459d092 Mon Sep 17 00:00:00 2001 From: Mate Barany Date: Mon, 2 Sep 2024 15:55:19 +0200 Subject: [PATCH] Pass CodeEntry by value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is a small and trivially copyable type. Found by an Axivion scan. Task-number: QTBUG-125026 Pick-to: 6.7 6.5 Change-Id: If8efe667f8b7a40038d904386ef2fed15cd8f94d Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Juha Vuolle (cherry picked from commit 9e0c3e85b5d102442ad519a3454d7c63fddf920d) Reviewed-by: Qt Cherry-pick Bot --- src/network/access/http2/huffman.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network/access/http2/huffman.cpp b/src/network/access/http2/huffman.cpp index e957c3311a..f5b6cd2ebe 100644 --- a/src/network/access/http2/huffman.cpp +++ b/src/network/access/http2/huffman.cpp @@ -316,7 +316,7 @@ const CodeEntry staticHuffmanCodeTable[] {256, 0xfffffffcul, 30} // EOS 11111111|11111111|11111111|111111 }; -void write_huffman_code(BitOStream &outputStream, const CodeEntry &code) +void write_huffman_code(BitOStream &outputStream, CodeEntry code) { // Append octet by octet. auto bitLength = code.bitLength; @@ -390,7 +390,7 @@ HuffmanDecoder::HuffmanDecoder() // Now we sort: by bit length first (in the descending order) and by the symbol // value (descending). Descending order: to make sure we do not create prefix tables with // short 'indexLength' first and having longer codes that do not fit into such tables later. - std::sort(symbols.begin(), symbols.end(), [](const CodeEntry &code1, const CodeEntry &code2) { + std::sort(symbols.begin(), symbols.end(), [](CodeEntry code1, CodeEntry code2) { if (code1.bitLength == code2.bitLength) return code1.byteValue > code2.byteValue; return code1.bitLength > code2.bitLength;