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

Function compareTokenRanges

lib/checkclass.cpp:3398–3419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3396}
3397
3398static bool compareTokenRanges(const Token* start1, const Token* end1, const Token* start2, const Token* end2) {
3399 const Token* tok1 = start1;
3400 const Token* tok2 = start2;
3401 bool isEqual = false;
3402 while (tok1 && tok2) {
3403 if (tok1->function() != tok2->function())
3404 break;
3405 if (tok1->str() != tok2->str())
3406 break;
3407 if (tok1->str() == "this")
3408 break;
3409 if (tok1->isExpandedMacro() || tok2->isExpandedMacro())
3410 break;
3411 if (tok1 == end1 && tok2 == end2) {
3412 isEqual = true;
3413 break;
3414 }
3415 tok1 = tok1->next();
3416 tok2 = tok2->next();
3417 }
3418 return isEqual;
3419}
3420
3421void CheckClassImpl::checkUselessOverride()
3422{

Callers 1

checkUselessOverrideMethod · 0.85

Calls 3

nextMethod · 0.80
functionMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected