summaryrefslogtreecommitdiff
path: root/src/mbgl/style/conversion/filter.cpp
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2020-03-20 12:38:09 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2020-03-23 12:09:09 +0200
commitd15b9c1f9c1afa29175ba2e398adc680e66147e6 (patch)
tree6bf426ae77d7386a6bbdee30444974bbc5dd76d0 /src/mbgl/style/conversion/filter.cpp
parent37802eec36aae3cb84c7f73a48652d9959489243 (diff)
downloadqtlocation-mapboxgl-d15b9c1f9c1afa29175ba2e398adc680e66147e6.tar.gz
[core] Fix performance-unnecessary-value-param errors
As reported by clang-tidy-8.
Diffstat (limited to 'src/mbgl/style/conversion/filter.cpp')
-rw-r--r--src/mbgl/style/conversion/filter.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/mbgl/style/conversion/filter.cpp b/src/mbgl/style/conversion/filter.cpp
index 0a10d1e80a..d665a4b22e 100644
--- a/src/mbgl/style/conversion/filter.cpp
+++ b/src/mbgl/style/conversion/filter.cpp
@@ -1,11 +1,12 @@
#include <mbgl/style/conversion/filter.hpp>
#include <mbgl/style/conversion_impl.hpp>
-#include <mbgl/style/expression/literal.hpp>
+#include <mbgl/style/expression/boolean_operator.hpp>
+#include <mbgl/style/expression/compound_expression.hpp>
#include <mbgl/style/expression/expression.hpp>
+#include <mbgl/style/expression/literal.hpp>
#include <mbgl/style/expression/type.hpp>
-#include <mbgl/style/expression/compound_expression.hpp>
-#include <mbgl/style/expression/boolean_operator.hpp>
#include <mbgl/util/geometry.hpp>
+#include <utility>
namespace mbgl {
namespace style {
@@ -78,7 +79,9 @@ bool isExpression(const Convertible& filter) {
}
}
-ParseResult createExpression(std::string op, optional<std::vector<std::unique_ptr<Expression>>> args, Error& error) {
+ParseResult createExpression(const std::string& op,
+ optional<std::vector<std::unique_ptr<Expression>>> args,
+ Error& error) {
if (!args) return {};
assert(std::all_of(args->begin(), args->end(), [](const std::unique_ptr<Expression> &e) {
return bool(e.get());
@@ -100,7 +103,7 @@ ParseResult createExpression(std::string op, optional<std::vector<std::unique_pt
}
}
-ParseResult createExpression(std::string op, ParseResult arg, Error& error) {
+ParseResult createExpression(const std::string& op, ParseResult arg, Error& error) {
if (!arg) {
return {};
}
@@ -134,7 +137,9 @@ optional<std::vector<std::unique_ptr<Expression>>> convertLiteralArray(const Con
return {std::move(output)};
}
-ParseResult convertLegacyComparisonFilter(const Convertible& values, Error& error, optional<std::string> opOverride = {}) {
+ParseResult convertLegacyComparisonFilter(const Convertible& values,
+ Error& error,
+ const optional<std::string>& opOverride = {}) {
optional<std::string> op = opOverride ? opOverride : toString(arrayMember(values, 0));
optional<std::string> property = toString(arrayMember(values, 1));