| 1606 | } |
| 1607 | |
| 1608 | static std::pair<const Token *, const Token *> isMapFind(const Token *tok) |
| 1609 | { |
| 1610 | if (!Token::simpleMatch(tok, "(")) |
| 1611 | return {}; |
| 1612 | if (!Token::simpleMatch(tok->astOperand1(), ".")) |
| 1613 | return {}; |
| 1614 | if (!astIsContainer(tok->astOperand1()->astOperand1())) |
| 1615 | return {}; |
| 1616 | const Token * contTok = tok->astOperand1()->astOperand1(); |
| 1617 | const Library::Container * container = contTok->valueType()->container; |
| 1618 | if (!container) |
| 1619 | return {}; |
| 1620 | if (!container->stdAssociativeLike) |
| 1621 | return {}; |
| 1622 | if (!Token::Match(tok->astOperand1(), ". find|count (")) |
| 1623 | return {}; |
| 1624 | if (!tok->astOperand2()) |
| 1625 | return {}; |
| 1626 | return {contTok, tok->astOperand2()}; |
| 1627 | } |
| 1628 | |
| 1629 | static const Token* skipLocalVars(const Token* const tok) |
| 1630 | { |
no test coverage detected