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

Fix #11450 cppcheck: error: Failed to add suppression. No id. #6722

Merged
merged 2 commits into from
Aug 27, 2024

Conversation

chrchr-github
Copy link
Collaborator

No description provided.

continue;
if (line.length() >= 2 && line[0] == '/' && line[1] == '/')
if (pos < line.size() - 1 && line[pos] == '/' && line[pos + 1] == '/')
Copy link
Owner

Choose a reason for hiding this comment

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

in general I prefer pos + 1 < line.size() instead of pos < line.size() - 1 it's more robust in case the string is empty. but well in this particular case we do know that it's not empty.

@chrchr-github chrchr-github merged commit 711ea51 into danmar:main Aug 27, 2024
63 checks passed
@chrchr-github chrchr-github deleted the chr_11450 branch August 27, 2024 08:21
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