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

Method calculateHash

lib/tokenlist.cpp:420–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

418//---------------------------------------------------------------------------
419
420std::size_t TokenList::calculateHash() const
421{
422 std::string hashData;
423 for (const Token* tok = front(); tok; tok = tok->next()) {
424 hashData += std::to_string(tok->flags());
425 hashData += std::to_string(tok->varId());
426 hashData += std::to_string(tok->tokType());
427 hashData += tok->str();
428 hashData += tok->originalName();
429 }
430 return (std::hash<std::string>{})(hashData);
431}
432
433
434//---------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 3

nextMethod · 0.80
frontFunction · 0.70
strMethod · 0.45

Tested by

no test coverage detected