Skip to content

utils.h: added startsWith() and started using it#5381

Merged
chrchr-github merged 3 commits into
cppcheck-opensource:mainfrom
firewave:startswith
Sep 8, 2023
Merged

utils.h: added startsWith() and started using it#5381
chrchr-github merged 3 commits into
cppcheck-opensource:mainfrom
firewave:startswith

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

@firewave firewave commented Aug 31, 2023

This makes the code much more readable. It also makes it less prone to errors because we do not need to specify the length of the string to match and the returnvalue is clear.

The code with the bad returnvalue check was never executed and I added a test to show that.

@firewave firewave changed the title utils.h: added startsWith() and use it utils.h: added startsWith() and started using it Aug 31, 2023
Comment thread gui/checkthread.cpp Outdated
@firewave firewave marked this pull request as draft August 31, 2023 16:33
@firewave
Copy link
Copy Markdown
Collaborator Author

Causes a minuscule performance regression (~4m instructions in the callgrind selfcheck in the CI) but still want to check it out first.

@firewave
Copy link
Copy Markdown
Collaborator Author

firewave commented Sep 1, 2023

Causes a minuscule performance regression (~4m instructions in the callgrind selfcheck in the CI) but still want to check it out first.

It is actually the other way around. I accidentally switched the output files...

@firewave firewave marked this pull request as ready for review September 1, 2023 09:53
@chrchr-github chrchr-github merged commit 91070ca into cppcheck-opensource:main Sep 8, 2023
@firewave firewave deleted the startswith branch September 8, 2023 17:31
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.

3 participants