[core] Fix out of range exception for string compare

This commit is contained in:
Vladimir Kondrashov
2018-08-13 11:25:33 -07:00
committed by Konstantin Käfer
parent 16e6ca86fa
commit 9ecb0997ef
3 changed files with 4 additions and 4 deletions

View File

@@ -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