summaryrefslogtreecommitdiff
path: root/src/mbgl/style
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2020-03-27 18:30:35 +0200
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2020-03-30 23:37:44 +0300
commit94d1c10727ceb2c0e245aeb3c255102da185440c (patch)
tree2f93534ca3dac24b3d3f566faa0b11fbf72177b9 /src/mbgl/style
parent2ca3fc24a1eedda8fb6fed1fa56033717376e0d7 (diff)
downloadqtlocation-mapboxgl-94d1c10727ceb2c0e245aeb3c255102da185440c.tar.gz
[core] Fix readability-* errors
As reported by clang-tidy-8.
Diffstat (limited to 'src/mbgl/style')
-rw-r--r--src/mbgl/style/custom_tile_loader.cpp2
-rw-r--r--src/mbgl/style/expression/compound_expression.cpp6
-rw-r--r--src/mbgl/style/expression/parsing_context.cpp8
-rw-r--r--src/mbgl/style/sources/image_source_impl.hpp2
4 files changed, 9 insertions, 9 deletions
diff --git a/src/mbgl/style/custom_tile_loader.cpp b/src/mbgl/style/custom_tile_loader.cpp
index d0b4dd58bc..eb17640dc8 100644
--- a/src/mbgl/style/custom_tile_loader.cpp
+++ b/src/mbgl/style/custom_tile_loader.cpp
@@ -52,7 +52,7 @@ void CustomTileLoader::removeTile(const OverscaledTileID& tileID) {
break;
}
}
- if (tileCallbacks->second.size() == 0) {
+ if (tileCallbacks->second.empty()) {
tileCallbackMap.erase(tileCallbacks);
dataCache.erase(tileID.canonical);
}
diff --git a/src/mbgl/style/expression/compound_expression.cpp b/src/mbgl/style/expression/compound_expression.cpp
index b95dabfc84..2477fe7917 100644
--- a/src/mbgl/style/expression/compound_expression.cpp
+++ b/src/mbgl/style/expression/compound_expression.cpp
@@ -368,7 +368,7 @@ const auto& hasContextCompoundExpression() {
};
}
- return params.feature->getValue(key) ? true : false;
+ return static_cast<bool>(params.feature->getValue(key));
});
return signature;
}
@@ -996,7 +996,7 @@ std::string expectedTypesError(const Definitions& definitions,
std::string actualTypes;
for (const auto& arg : args) {
- if (actualTypes.size() > 0) {
+ if (!actualTypes.empty()) {
actualTypes += ", ";
}
actualTypes += toString(arg->getType());
@@ -1043,7 +1043,7 @@ static ParseResult createCompoundExpression(const Definitions& definitions,
}
}
- if (signatureContext.getErrors().size() == 0) {
+ if (signatureContext.getErrors().empty()) {
return ParseResult(std::make_unique<CompoundExpression>(*signature, std::move(args)));
}
}
diff --git a/src/mbgl/style/expression/parsing_context.cpp b/src/mbgl/style/expression/parsing_context.cpp
index ad1a46b8d6..56556d770c 100644
--- a/src/mbgl/style/expression/parsing_context.cpp
+++ b/src/mbgl/style/expression/parsing_context.cpp
@@ -207,7 +207,7 @@ ParseResult ParsingContext::parse(const Convertible& value,
parsed = { annotate(std::move(*parsed), *expected, typeAnnotationOption.value_or(TypeAnnotationOption::coerce)) };
} else {
checkType((*parsed)->getType());
- if (errors->size() > 0) {
+ if (!errors->empty()) {
return ParseResult();
}
}
@@ -265,13 +265,13 @@ ParseResult ParsingContext::parseLayerPropertyExpression(const Convertible& valu
return parsed;
}
-const std::string ParsingContext::getCombinedErrors() const {
+std::string ParsingContext::getCombinedErrors() const {
std::string combinedError;
for (const ParsingError& parsingError : *errors) {
- if (combinedError.size() > 0) {
+ if (!combinedError.empty()) {
combinedError += "\n";
}
- if (parsingError.key.size() > 0) {
+ if (!parsingError.key.empty()) {
combinedError += parsingError.key + ": ";
}
combinedError += parsingError.message;
diff --git a/src/mbgl/style/sources/image_source_impl.hpp b/src/mbgl/style/sources/image_source_impl.hpp
index 1e1b005a32..d784464709 100644
--- a/src/mbgl/style/sources/image_source_impl.hpp
+++ b/src/mbgl/style/sources/image_source_impl.hpp
@@ -12,7 +12,7 @@ namespace style {
class ImageSource::Impl : public Source::Impl {
public:
Impl(std::string id, std::array<LatLng, 4> coords);
- Impl(const Impl& rhs, std::array<LatLng, 4> coords);
+ Impl(const Impl& other, std::array<LatLng, 4> coords);
Impl(const Impl& rhs, PremultipliedImage&& image);
~Impl() final;