[core] Fix out of range exception for string compare
This commit is contained in:
committed by
Konstantin Käfer
parent
16e6ca86fa
commit
9ecb0997ef
@@ -75,7 +75,7 @@ std::unique_ptr<AsyncRequest> AssetFileSource::request(const Resource& resource,
|
||||
}
|
||||
|
||||
bool AssetFileSource::acceptsURL(const std::string& url) {
|
||||
return std::equal(assetProtocol.begin(), assetProtocol.end(), url.begin());
|
||||
return 0 == url.rfind(assetProtocol, 0);
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -75,7 +75,7 @@ std::unique_ptr<AsyncRequest> LocalFileSource::request(const Resource& resource,
|
||||
}
|
||||
|
||||
bool LocalFileSource::acceptsURL(const std::string& url) {
|
||||
return std::equal(fileProtocol.begin(), fileProtocol.end(), url.begin());
|
||||
return 0 == url.rfind(fileProtocol, 0);
|
||||
}
|
||||
|
||||
} // namespace mbgl
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user