From bf50d79cf3495d9b5fcb68421d16beca647838df Mon Sep 17 00:00:00 2001 From: kevin Date: Tue, 24 Mar 2020 10:39:36 +0800 Subject: FIx review comments --- platform/android/src/snapshotter/map_snapshotter.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/platform/android/src/snapshotter/map_snapshotter.cpp b/platform/android/src/snapshotter/map_snapshotter.cpp index adf654cb10..5bccbd1ba8 100644 --- a/platform/android/src/snapshotter/map_snapshotter.cpp +++ b/platform/android/src/snapshotter/map_snapshotter.cpp @@ -225,35 +225,35 @@ void MapSnapshotter::addLayerBelow(JNIEnv& env, jlong nativeLayerPtr, const jni: void MapSnapshotter::addLayerAbove(JNIEnv& env, jlong nativeLayerPtr, const jni::String& above) { assert(nativeLayerPtr != 0); - auto* layer = reinterpret_cast(nativeLayerPtr); + auto* newLayer = reinterpret_cast(nativeLayerPtr); // Find the sibling - const auto layers = snapshotter->getStyle().getLayers(); + const auto snapshotterLayers = snapshotter->getStyle().getLayers(); auto siblingId = jni::Make(env, above); size_t index = 0; - for (auto* l : layers) { + for (auto* snapshotterLayer : snapshotterLayers) { ++index; - if (l->getID() == siblingId) { + if (snapshotterLayer->getID() == siblingId) { break; } } // Check if we found a sibling to place before mbgl::optional before; - if (index > layers.size()) { + if (index > snapshotterLayers.size()) { // Not found jni::ThrowNew(env, jni::FindClass(env, "com/mapbox/mapboxsdk/style/layers/CannotAddLayerException"), std::string("Could not find layer: ").append(siblingId).c_str()); - } else if (index < layers.size()) { + } else if (index < snapshotterLayers.size()) { // Place before the sibling - before = {layers.at(index)->getID()}; + before = {snapshotterLayers.at(index)->getID()}; } // Add the layer try { - layer->addToStyle(snapshotter->getStyle(), before); + newLayer->addToStyle(snapshotter->getStyle(), before); } catch (const std::runtime_error& error) { jni::ThrowNew( env, jni::FindClass(env, "com/mapbox/mapboxsdk/style/layers/CannotAddLayerException"), error.what()); @@ -276,7 +276,7 @@ void MapSnapshotter::addImages(JNIEnv& env, const jni::ArraygetStyle().addImage(std::make_unique(image)); } -- cgit v1.2.1