Skip to content

symboldatabase.cpp: avoid duplicated ValueType::typeFromString() calls in parsedecl()#7824

Merged
chrchr-github merged 1 commit intodanmar:mainfrom
firewave:typestr
Sep 15, 2025
Merged

symboldatabase.cpp: avoid duplicated ValueType::typeFromString() calls in parsedecl()#7824
chrchr-github merged 1 commit intodanmar:mainfrom
firewave:typestr

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

No description provided.

@firewave
Copy link
Copy Markdown
Collaborator Author

firewave commented Sep 15, 2025

Analyzing the code from https://trac.cppcheck.net/ticket/12861 with DISABLE_VALUEFLOW=1
539,794,953-> 537,304,077

Reduction of actual lookups in the affected call
196,642 -> 131,092

Callgrind in CI
56,331,470,251 -> 56,301,645,896

@sonarqubecloud
Copy link
Copy Markdown

@firewave
Copy link
Copy Markdown
Collaborator Author

The code is rather awkward because it leverages that ValueType::Type::UNKNOWN_TYPE is 0 in the if-condition.

@chrchr-github chrchr-github merged commit 3e169d6 into danmar:main Sep 15, 2025
61 checks passed
@firewave firewave deleted the typestr branch September 15, 2025 11:41
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