Skip to content

avoid unnecessary lookups in TokenList::isKeyword()#7513

Merged
firewave merged 1 commit into
cppcheck-opensource:mainfrom
firewave:iskey
May 9, 2025
Merged

avoid unnecessary lookups in TokenList::isKeyword()#7513
firewave merged 1 commit into
cppcheck-opensource:mainfrom
firewave:iskey

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

@firewave firewave commented May 7, 2025

No description provided.

Comment thread lib/tokenlist.cpp
if (b) {
// TODO: integrate into keywords?
// types and literals are not handled as keywords
static const std::unordered_set<std::string> cpp_types = {"bool", "false", "true"};
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am curious why this does not include the types we filter out with C code. But out of the scope of this change.

@firewave firewave marked this pull request as ready for review May 8, 2025 11:58
@firewave
Copy link
Copy Markdown
Collaborator Author

firewave commented May 8, 2025

From the callgrind step in the CI
57,330,825,872 -> 57,291,147,309

@firewave firewave merged commit 5962f16 into cppcheck-opensource:main May 9, 2025
53 checks passed
@firewave firewave deleted the iskey branch May 9, 2025 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants