Here relevant code:
std::list<RsGxsId> own_identities ;
if(own_identities.size() <= 1)
if(own_identities.empty())
else
This code is not dead as size() could be 0 or 1, so empty() check doesn't make dead code.
Hope I'm clear.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I've got a warning checking this project: https://github.com/RetroShare/RetroShare
/retroshare-gui/src/gui/Identity/IdDialog.cpp:2437: warning: Cppcheck(oppositeInnerCondition): Opposite inner 'if' condition leads to a dead code block.
https://github.com/RetroShare/RetroShare/blob/062e00d96093759a74782f72639a623c54600a27/retroshare-gui/src/gui/Identity/IdDialog.cpp#L2433
Here relevant code:
std::list<RsGxsId> own_identities ;
if(own_identities.size() <= 1)
if(own_identities.empty())
else
This code is not dead as size() could be 0 or 1, so empty() check doesn't make dead code.
Hope I'm clear.
Thank you very much for the report.
I have not found a ticket regarding this issue so i created ticket 8555.