Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[core] Fix initialization race on util::mapbox::isMapboxURL #6455

Merged
merged 1 commit into from
Sep 26, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/mbgl/util/mapbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@
#include <vector>
#include <iostream>

namespace {

const char* protocol = "mapbox://";
const std::size_t protocolLength = 9;

} // namespace

namespace mbgl {
namespace util {
namespace mapbox {

const std::string protocol = "mapbox://";
const std::size_t protocolLength = protocol.length();

bool isMapboxURL(const std::string& url) {
return std::equal(protocol.begin(), protocol.end(), url.begin());
return url.compare(0, protocolLength, protocol) == 0;
}

static std::vector<std::string> getMapboxURLPathname(const std::string& url) {
Expand Down