diff options
author | Shivam Gupta <shivam98.tkg@gmail.com> | 2024-06-10 13:53:39 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-10 13:53:39 +0530 |
commit | 0af2e75f8c688cc6fb7123c969c8edfa98a003fa (patch) | |
tree | 333ff3bf2c5315c7eb9105cbc518c51a02344de6 /lldb/source | |
parent | 0257f9cde540f265da38ef14fd395f76d3e08bb1 (diff) | |
download | llvm-0af2e75f8c688cc6fb7123c969c8edfa98a003fa.zip llvm-0af2e75f8c688cc6fb7123c969c8edfa98a003fa.tar.gz llvm-0af2e75f8c688cc6fb7123c969c8edfa98a003fa.tar.bz2 |
[lldb] Fix redundant condition in compression type check (NFC) (#94841)
The `else if` condition for checking `m_compression_type` is redundant
as it matches with a previous `if` condition, making the expression
always false. Reported by cppcheck as a possible cut-and-paste error.
Caught by cppcheck -
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp:543:35:
style: Expression is always false because 'else if' condition matches
previous condition at line 535. [multiCondition]
Fix #91222
Diffstat (limited to 'lldb/source')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index 8a47eed..187370e 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -539,9 +539,8 @@ bool GDBRemoteCommunication::DecompressPacket() { else if (m_compression_type == CompressionType::ZlibDeflate) scratchbuf_size = compression_decode_scratch_buffer_size (COMPRESSION_ZLIB); else if (m_compression_type == CompressionType::LZMA) - scratchbuf_size = compression_decode_scratch_buffer_size (COMPRESSION_LZMA); - else if (m_compression_type == CompressionType::LZFSE) - scratchbuf_size = compression_decode_scratch_buffer_size (COMPRESSION_LZFSE); + scratchbuf_size = + compression_decode_scratch_buffer_size(COMPRESSION_LZMA); if (scratchbuf_size > 0) { m_decompression_scratch = (void*) malloc (scratchbuf_size); m_decompression_scratch_type = m_compression_type; |