From 70b158bb1a240cf5c50b9fd295f538f6eb2432a7 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 11 Oct 2016 11:25:41 -0700 Subject: [PATCH] folly/ConcurrentSkipList.h: avoid shadowing warnings (trivial) Summary: Compiling with gcc's proposed -Wshadow-compatible-local option exposed some fix-worthy warnings. Rename to avoid the shadowing. Reviewed By: evilmucedin Differential Revision: D3999026 fbshipit-source-id: 26cb3033ba8c5538cc9217993f2fda6aef954a8f --- folly/ConcurrentSkipList.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/folly/ConcurrentSkipList.h b/folly/ConcurrentSkipList.h index ff84de41..2f8f0254 100644 --- a/folly/ConcurrentSkipList.h +++ b/folly/ConcurrentSkipList.h @@ -328,9 +328,9 @@ class ConcurrentSkipList { // locks acquired and all valid, need to modify the links under the locks. newNode = NodeType::create(recycler_.alloc(), nodeHeight, std::forward(data)); - for (int layer = 0; layer < nodeHeight; ++layer) { - newNode->setSkip(layer, succs[layer]); - preds[layer]->setSkip(layer, newNode); + for (int k = 0; k < nodeHeight; ++k) { + newNode->setSkip(k, succs[k]); + preds[k]->setSkip(k, newNode); } newNode->setFullyLinked(); @@ -378,8 +378,8 @@ class ConcurrentSkipList { continue; // this will unlock all the locks } - for (int layer = nodeHeight - 1; layer >= 0; --layer) { - preds[layer]->setSkip(layer, nodeToDelete->skip(layer)); + for (int k = nodeHeight - 1; k >= 0; --k) { + preds[k]->setSkip(k, nodeToDelete->skip(k)); } incrementSize(-1); -- 2.34.1