MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / getOtherOperand

Function getOtherOperand

lib/valueflow.cpp:695–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

693}
694
695static const Token* getOtherOperand(const Token* tok)
696{
697 if (!tok)
698 return nullptr;
699 if (!tok->astParent())
700 return nullptr;
701 if (tok->astParent()->astOperand1() != tok)
702 return tok->astParent()->astOperand1();
703 if (tok->astParent()->astOperand2() != tok)
704 return tok->astParent()->astOperand2();
705 return nullptr;
706}
707
708static void valueFlowArrayBool(TokenList& tokenlist, const Settings& settings)
709{

Callers 1

valueFlowArrayBoolFunction · 0.85

Calls 3

astParentMethod · 0.80
astOperand1Method · 0.80
astOperand2Method · 0.80

Tested by

no test coverage detected