Skip to content

Commit

Permalink
Hash remodel
Browse files Browse the repository at this point in the history
  • Loading branch information
olabetskyi committed Jun 10, 2024
1 parent 8173aa8 commit 204ed48
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/preprocessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -954,14 +954,16 @@ std::size_t Preprocessor::calculateHash(const simplecpp::TokenList &tokens1, con
for (const simplecpp::Token *tok = tokens1.cfront(); tok; tok = tok->next) {
if (!tok->comment) {
hashData += tok->str();
hashData += tok->location.line / tok->location.col;
hashData += static_cast<char>(tok->location.line);
hashData += static_cast<char>(tok->location.col);
}
}
for (std::map<std::string, simplecpp::TokenList *>::const_iterator it = mTokenLists.cbegin(); it != mTokenLists.cend(); ++it) {
for (const simplecpp::Token *tok = it->second->cfront(); tok; tok = tok->next) {
if (!tok->comment) {
hashData += tok->str();
hashData += tok->location.line / tok->location.col;
hashData += static_cast<char>(tok->location.line);
hashData += static_cast<char>(tok->location.col);
}
}
}
Expand Down

0 comments on commit 204ed48

Please sign in to comment.