Skip to content

Commit 558315a

Browse files
xguptaxgupta
andauthored
[LLDB] Remove the redundent 'properties' variable (#95675)
This is described in (N3) https://pvs-studio.com/en/blog/posts/cpp/1126/ 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'. --------- Co-authored-by: xgupta <[email protected]>
1 parent a09c0f6 commit 558315a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lldb/source/Commands/CommandObjectTarget.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static void DumpTargetInfo(uint32_t target_idx, Target *target,
9797

9898
uint32_t properties = 0;
9999
if (target_arch.IsValid()) {
100-
strm.Printf("%sarch=", properties++ > 0 ? ", " : " ( ");
100+
strm.Printf(" ( arch=");
101101
target_arch.DumpTriple(strm.AsRawOstream());
102102
properties++;
103103
}

0 commit comments

Comments
 (0)