Skip to content

removed unnecessary Settings parameter from Check::runChecks() and made Tokenizer a reference#5308

Merged
danmar merged 1 commit into
cppcheck-opensource:mainfrom
firewave:tokenize
Aug 18, 2023
Merged

removed unnecessary Settings parameter from Check::runChecks() and made Tokenizer a reference#5308
danmar merged 1 commit into
cppcheck-opensource:mainfrom
firewave:tokenize

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

@firewave firewave commented Aug 9, 2023

There was no need for the Tokenizer parameter to be a pointer as it could never be nullptr and was also dereferenced without checking first.

As a reference to the Settings was already available via the Tokenizer there was no need to pass it separately. In the production code there will only be one instance of it but in the tests we could have accidentally passed a different one.

@firewave
Copy link
Copy Markdown
Collaborator Author

firewave commented Aug 9, 2023

The signature matched the constructor of the checks which might be created without a Tokenizer and thus need to pass the Settings by itself. That's because that constructor is used for the instance object and for a temporary object for fetching the error messages. I tried to separate/untangle this in the past but I have not been successful. I might give that a try again since it enables several interface cleanups for the checks.

@firewave firewave marked this pull request as draft August 9, 2023 21:02
@firewave firewave marked this pull request as ready for review August 9, 2023 21:07
@danmar danmar merged commit bfb50ca into cppcheck-opensource:main Aug 18, 2023
@firewave firewave deleted the tokenize branch August 18, 2023 11:46
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