Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: The code to generate id string from pointer can be simplified #5382

Merged
merged 4 commits into from
Aug 31, 2023

Conversation

danmar
Copy link
Owner

@danmar danmar commented Aug 31, 2023

The id string should just be a unique value. There is no need that this value is equal to the pointer. And there is no requirement to use the same hexadecimal output format as the ostringstream implementation. Therefore the code to generate the id can be simplified.

@danmar danmar requested a review from firewave August 31, 2023 13:19
test/testutils.cpp Outdated Show resolved Hide resolved
@firewave
Copy link
Collaborator

Just from taking a quick look this introduces a completely new format. We should at least try to match one of the existing ones - I would go with [0-9a-f] with a fixed size as it was the result of possibly the most common one.

@danmar
Copy link
Owner Author

danmar commented Aug 31, 2023

with a fixed size

I see no advantage for a fixed size when it's used as a id string..

fewer bytes means the addons that use cppcheckdata.py will load the dump files a little quicker (there are lots of string comparisons of these id strings as far as I know) and that the dump files will be a little smaller.

@danmar danmar merged commit c3136db into main Aug 31, 2023
142 checks passed
@danmar danmar deleted the refactor-dumpfile-id branch August 31, 2023 21:14
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