Commit 584b3cb8 authored by Volker Krause's avatar Volker Krause
Browse files

Don't needlessly copy the MapCSS state

parent af46f3ad
...@@ -71,7 +71,7 @@ bool MapCSSBasicSelector::matches(const MapCSSState &state) const ...@@ -71,7 +71,7 @@ bool MapCSSBasicSelector::matches(const MapCSSState &state) const
case Any: break; case Any: break;
} }
return std::all_of(conditions.begin(), conditions.end(), [state](const auto &cond) { return cond->matches(state); }); return std::all_of(conditions.begin(), conditions.end(), [&state](const auto &cond) { return cond->matches(state); });
} }
bool MapCSSBasicSelector::matchesCanvas(const MapCSSState &state) const bool MapCSSBasicSelector::matchesCanvas(const MapCSSState &state) const
...@@ -87,7 +87,7 @@ bool MapCSSBasicSelector::matchesCanvas(const MapCSSState &state) const ...@@ -87,7 +87,7 @@ bool MapCSSBasicSelector::matchesCanvas(const MapCSSState &state) const
return false; return false;
} }
return std::all_of(conditions.begin(), conditions.end(), [state](const auto &cond) { return cond->matchesCanvas(state); }); return std::all_of(conditions.begin(), conditions.end(), [&state](const auto &cond) { return cond->matchesCanvas(state); });
} }
struct { struct {
...@@ -212,12 +212,12 @@ void MapCSSUnionSelector::compile(const OSM::DataSet &dataSet) ...@@ -212,12 +212,12 @@ void MapCSSUnionSelector::compile(const OSM::DataSet &dataSet)
bool MapCSSUnionSelector::matches(const MapCSSState &state) const bool MapCSSUnionSelector::matches(const MapCSSState &state) const
{ {
return std::any_of(selectors.begin(), selectors.end(), [state](const auto &selector) { return selector->matches(state); }); return std::any_of(selectors.begin(), selectors.end(), [&state](const auto &selector) { return selector->matches(state); });
} }
bool MapCSSUnionSelector::matchesCanvas(const MapCSSState &state) const bool MapCSSUnionSelector::matchesCanvas(const MapCSSState &state) const
{ {
return std::any_of(selectors.begin(), selectors.end(), [state](const auto &selector) { return selector->matchesCanvas(state); }); return std::any_of(selectors.begin(), selectors.end(), [&state](const auto &selector) { return selector->matchesCanvas(state); });
} }
void MapCSSUnionSelector::write(QIODevice *out) const void MapCSSUnionSelector::write(QIODevice *out) const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment