Reduce number of copies in query::Parameters
Reviewers: teon.banek Reviewed By: teon.banek Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D2564
This commit is contained in:
parent
3c615759b6
commit
42a4f310ff
@ -33,10 +33,9 @@ struct Parameters {
|
|||||||
* @return Value for the given token position.
|
* @return Value for the given token position.
|
||||||
*/
|
*/
|
||||||
const PropertyValue &AtTokenPosition(int position) const {
|
const PropertyValue &AtTokenPosition(int position) const {
|
||||||
auto found = std::find_if(storage_.begin(), storage_.end(),
|
auto found =
|
||||||
[&](const std::pair<int, PropertyValue> a) {
|
std::find_if(storage_.begin(), storage_.end(),
|
||||||
return a.first == position;
|
[&](const auto &a) { return a.first == position; });
|
||||||
});
|
|
||||||
CHECK(found != storage_.end())
|
CHECK(found != storage_.end())
|
||||||
<< "Token position must be present in container";
|
<< "Token position must be present in container";
|
||||||
return found->second;
|
return found->second;
|
||||||
|
Loading…
Reference in New Issue
Block a user