Skip to content

avoid redundant Token::declEndToken() calls#4363

Merged
danmar merged 2 commits into
cppcheck-opensource:mainfrom
firewave:declend
Aug 20, 2022
Merged

avoid redundant Token::declEndToken() calls#4363
danmar merged 2 commits into
cppcheck-opensource:mainfrom
firewave:declend

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread lib/valueflow.cpp Outdated
// TODO: the inserted data is never used
er.insert(er.end(), errorPath.begin(), errorPath.end());
if (!var)
if (!var || !tok)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The check for tok should be moved outside the loop.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Yeah - that's even better. I just did so not to introduce declEndToken() call where there was none before.

While we are at this code - please take a look at the TODO as well.

@firewave firewave marked this pull request as draft August 16, 2022 20:13
@firewave firewave marked this pull request as ready for review August 20, 2022 09:30
Comment thread lib/astutils.cpp
@danmar danmar merged commit d73a33d into cppcheck-opensource:main Aug 20, 2022
@firewave firewave deleted the declend branch August 20, 2022 19:40
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