diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2020-03-27 18:30:35 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2020-03-30 23:37:44 +0300 |
commit | 94d1c10727ceb2c0e245aeb3c255102da185440c (patch) | |
tree | 2f93534ca3dac24b3d3f566faa0b11fbf72177b9 /src/mbgl/style/expression | |
parent | 2ca3fc24a1eedda8fb6fed1fa56033717376e0d7 (diff) | |
download | qtlocation-mapboxgl-94d1c10727ceb2c0e245aeb3c255102da185440c.tar.gz |
[core] Fix readability-* errors
As reported by clang-tidy-8.
Diffstat (limited to 'src/mbgl/style/expression')
-rw-r--r-- | src/mbgl/style/expression/compound_expression.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/style/expression/parsing_context.cpp | 8 |
2 files changed, 7 insertions, 7 deletions
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; |