Skip to content

Commit 0af2e75

Browse files
authored
[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
1 parent 0257f9c commit 0af2e75

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,8 @@ bool GDBRemoteCommunication::DecompressPacket() {
539539
else if (m_compression_type == CompressionType::ZlibDeflate)
540540
scratchbuf_size = compression_decode_scratch_buffer_size (COMPRESSION_ZLIB);
541541
else if (m_compression_type == CompressionType::LZMA)
542-
scratchbuf_size = compression_decode_scratch_buffer_size (COMPRESSION_LZMA);
543-
else if (m_compression_type == CompressionType::LZFSE)
544-
scratchbuf_size = compression_decode_scratch_buffer_size (COMPRESSION_LZFSE);
542+
scratchbuf_size =
543+
compression_decode_scratch_buffer_size(COMPRESSION_LZMA);
545544
if (scratchbuf_size > 0) {
546545
m_decompression_scratch = (void*) malloc (scratchbuf_size);
547546
m_decompression_scratch_type = m_compression_type;

0 commit comments

Comments
 (0)