[core] Fix performance-unnecessary-value-param errors

As reported by clang-tidy-8.
This commit is contained in:
Thiago Marcos P. Santos
2020-03-20 12:38:09 +02:00
parent 37802eec36
commit d15b9c1f9c
112 changed files with 543 additions and 479 deletions

View File

@@ -1,6 +1,7 @@
#include <mbgl/style/expression/expression.hpp>
#include <mbgl/style/expression/compound_expression.hpp>
#include <mbgl/style/expression/expression.hpp>
#include <mbgl/tile/geometry_tile_data.hpp>
#include <utility>
namespace mbgl {
namespace style {
@@ -43,7 +44,7 @@ EvaluationResult Expression::evaluate(optional<float> zoom,
const Feature& feature,
optional<double> colorRampParameter) const {
GeoJSONFeature f(feature);
return this->evaluate(EvaluationContext(zoom, &f, colorRampParameter));
return this->evaluate(EvaluationContext(std::move(zoom), &f, std::move(colorRampParameter)));
}
EvaluationResult Expression::evaluate(optional<float> zoom,
@@ -51,7 +52,8 @@ EvaluationResult Expression::evaluate(optional<float> zoom,
optional<double> colorRampParameter,
const std::set<std::string>& availableImages) const {
GeoJSONFeature f(feature);
return this->evaluate(EvaluationContext(zoom, &f, colorRampParameter).withAvailableImages(&availableImages));
return this->evaluate(
EvaluationContext(std::move(zoom), &f, std::move(colorRampParameter)).withAvailableImages(&availableImages));
}
EvaluationResult Expression::evaluate(optional<float> zoom,
@@ -60,14 +62,14 @@ EvaluationResult Expression::evaluate(optional<float> zoom,
const std::set<std::string>& availableImages,
const CanonicalTileID& canonical) const {
GeoJSONFeature f(feature, canonical);
return this->evaluate(EvaluationContext(zoom, &f, colorRampParameter)
return this->evaluate(EvaluationContext(std::move(zoom), &f, std::move(colorRampParameter))
.withAvailableImages(&availableImages)
.withCanonicalTileID(&canonical));
}
EvaluationResult Expression::evaluate(optional<mbgl::Value> accumulated, const Feature& feature) const {
GeoJSONFeature f(feature);
return this->evaluate(EvaluationContext(accumulated, &f));
return this->evaluate(EvaluationContext(std::move(accumulated), &f));
}
} // namespace expression