Skip to content

Commit

Permalink
astutils.cpp: Improved const correctness
Browse files Browse the repository at this point in the history
  • Loading branch information
orbitcowboy committed Jun 2, 2022
1 parent 4e9565b commit 3dfe9ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/astutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ static bool isSameLifetime(const Token * const tok1, const Token * const tok2)
return v1.tokvalue == v2.tokvalue;
}

static bool compareKnownValue(const Token * const tok1, const Token * const tok2, std::function<bool(const ValueFlow::Value&, const ValueFlow::Value&, bool)> compare)
static bool compareKnownValue(const Token * const tok1, const Token * const tok2, const std::function<bool(const ValueFlow::Value&, const ValueFlow::Value&, bool)> & compare)
{
static const auto isKnownFn = std::mem_fn(&ValueFlow::Value::isKnown);

Expand Down

2 comments on commit 3dfe9ef

@firewave
Copy link
Collaborator

Choose a reason for hiding this comment

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

@orbitcowboy
This is an unnecessary change. Since the lambdas are used in-place they were implicitly being moved by the old signature.

@orbitcowboy
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@orbitcowboy This is an unnecessary change. Since the lambdas are used in-place they were implicitly being moved by the old signature.
Thanks! Reverted with 9b0f41e

Please sign in to comment.