MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / operator()

Method operator()

lib/checkother.cpp:1846–1858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1844namespace {
1845 struct CompareVariables {
1846 bool operator()(const Variable* a, const Variable* b) const {
1847 const int fileA = a->nameToken()->fileIndex();
1848 const int fileB = b->nameToken()->fileIndex();
1849 if (fileA != fileB)
1850 return fileA < fileB;
1851 const int lineA = a->nameToken()->linenr();
1852 const int lineB = b->nameToken()->linenr();
1853 if (lineA != lineB)
1854 return lineA < lineB;
1855 const int columnA = a->nameToken()->column();
1856 const int columnB = b->nameToken()->column();
1857 return columnA < columnB;
1858 }
1859 };
1860}
1861

Callers

nothing calls this directly

Calls 3

fileIndexMethod · 0.80
columnMethod · 0.80
nameTokenMethod · 0.45

Tested by

no test coverage detected