diff --git a/src/mbgl/style/collection.hpp b/src/mbgl/style/collection.hpp
index 91244cb71..7d67fac94 100644
--- a/src/mbgl/style/collection.hpp
+++ b/src/mbgl/style/collection.hpp
@@ -63,12 +63,12 @@ class Collection : public CollectionBase {
public:
T* add(std::unique_ptr wrapper, const optional& before = nullopt) {
- std::size_t index = before ? Base::index(*before) : Base::size();
- return Base::add(index, index, std::move(wrapper));
+ std::size_t idx = before ? Base::index(*before) : Base::size();
+ return Base::add(idx, idx, std::move(wrapper));
}
std::unique_ptr remove(const std::string& id) {
- std::size_t index = Base::index(id);
- return Base::remove(index, index);
+ std::size_t idx = Base::index(id);
+ return Base::remove(idx, idx);
}
void update(const T& wrapper) { Base::update(Base::index(wrapper.getID()), wrapper); }
};
diff --git a/src/mbgl/style/sources/geojson_source.cpp b/src/mbgl/style/sources/geojson_source.cpp
index ea6fb5cc6..7767859b3 100644
--- a/src/mbgl/style/sources/geojson_source.cpp
+++ b/src/mbgl/style/sources/geojson_source.cpp
@@ -78,16 +78,16 @@ void GeoJSONSource::loadDescription(FileSource& fileSource) {
} else {
auto makeImplInBackground = [currentImpl = baseImpl, data = res.data]() -> Immutable {
assert(data);
- auto& impl = static_cast(*currentImpl);
+ auto& current = static_cast(*currentImpl);
conversion::Error error;
std::shared_ptr geoJSONData;
if (optional geoJSON = conversion::convertJSON(*data, error)) {
- geoJSONData = GeoJSONData::create(*geoJSON, impl.getOptions());
+ geoJSONData = GeoJSONData::create(*geoJSON, current.getOptions());
} else {
// Create an empty GeoJSON VT object to make sure we're not infinitely waiting for tiles to load.
Log::Error(Event::ParseStyle, "Failed to parse GeoJSON data: %s", error.message.c_str());
}
- return makeMutable(impl, std::move(geoJSONData));
+ return makeMutable(current, std::move(geoJSONData));
};
auto onImplReady = [this, self = makeWeakPtr(), capturedReq = req.get()](Immutable newImpl) {
assert(capturedReq);