https://github.com/xgupta created https://github.com/llvm/llvm-project/pull/95675
This is described in (N3) https://pvs-studio.com/en/blog/posts/cpp/1126/ so caught by the PVS Studio analyzer. Warning message - V547 Expression 'properties ++ > 0' is always false. CommandObjectTarget.cpp:100 I could not understand it properly but the properties++ operation is performed twice when the target architecture is valid. First increment seems unnecessary since it is always false '0>0'. >From a305b3958b3bf5551fda2d17af8eb11b9d122125 Mon Sep 17 00:00:00 2001 From: Shivam Gupta <shivam98....@gmail.com> Date: Sat, 15 Jun 2024 23:12:19 +0530 Subject: [PATCH] [LLDB] Remove the redundent increment of 'properties' variable This is described in (N3) https://pvs-studio.com/en/blog/posts/cpp/1126/ so caught by the PVS Studio analyzer. Warning message - V547 Expression 'properties ++ > 0' is always false. CommandObjectTarget.cpp:100 I could not understand it properly but the properties++ operation is performed twice when the target architecture is valid. First increment seems unnecessary since it is always false '0>0'. --- lldb/source/Commands/CommandObjectTarget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index ae6c6d5479a19..c3d4307267a1b 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -97,7 +97,7 @@ static void DumpTargetInfo(uint32_t target_idx, Target *target, uint32_t properties = 0; if (target_arch.IsValid()) { - strm.Printf("%sarch=", properties++ > 0 ? ", " : " ( "); + strm.Printf("%sarch=", properties > 0 ? ", " : " ( "); target_arch.DumpTriple(strm.AsRawOstream()); properties++; } _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits