From 9ecb0997effb006e88c25d6fbca2570c8ab51adc Mon Sep 17 00:00:00 2001 From: Vladimir Kondrashov Date: Mon, 13 Aug 2018 11:25:33 -0700 Subject: [core] Fix out of range exception for string compare --- src/mbgl/style/expression/is_constant.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') 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 -- cgit v1.2.1