summaryrefslogtreecommitdiff
path: root/src/mbgl/style
diff options
context:
space:
mode:
authorVladimir Kondrashov <vkondrashov@tableau.com>2018-08-13 11:25:33 -0700
committerKonstantin Käfer <mail@kkaefer.com>2018-08-14 11:16:10 -0700
commit9ecb0997effb006e88c25d6fbca2570c8ab51adc (patch)
tree2b49bf4bde7d137a2b1e038ef7a4b025cc1a5907 /src/mbgl/style
parent16e6ca86faad8527af529b3a6de0751dbac447d6 (diff)
downloadqtlocation-mapboxgl-9ecb0997effb006e88c25d6fbca2570c8ab51adc.tar.gz
[core] Fix out of range exception for string compare
Diffstat (limited to 'src/mbgl/style')
-rw-r--r--src/mbgl/style/expression/is_constant.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/style/expression/is_constant.cpp b/src/mbgl/style/expression/is_constant.cpp
index 69f27f6fef..3b20f49a86 100644
--- a/src/mbgl/style/expression/is_constant.cpp
+++ b/src/mbgl/style/expression/is_constant.cpp
@@ -17,7 +17,7 @@ bool isFeatureConstant(const Expression& expression) {
return false;
} else if (name == "has" && parameterCount && *parameterCount == 1) {
return false;
- } else if (std::equal(std::begin(filter), std::end(filter) - 1, name.begin())) {
+ } else if (0 == name.rfind(filter, 0)) {
// Legacy filters begin with "filter-" and are never constant.
return false;
} else if (
@@ -28,7 +28,7 @@ bool isFeatureConstant(const Expression& expression) {
return false;
}
}
-
+
if (expression.getKind() == Kind::CollatorExpression) {
// Although the results of a Collator expression with fixed arguments
// generally shouldn't change between executions, we can't serialize them