Commit a60bf0bb authored by Uladzislau Paulovich's avatar Uladzislau Paulovich Committed by Facebook Github Bot

Fix class member shadowing in folly::ProducerConsumerQueue

Summary: Previous version failed to compile with "-Werror=shadow" flag, this commit fixes the problem.

Reviewed By: WillerZ

Differential Revision: D5255814

fbshipit-source-id: c1252474ed5415b47759022bcbabc78c1639e10a
parent ff607e1b
...@@ -64,12 +64,12 @@ struct ProducerConsumerQueue { ...@@ -64,12 +64,12 @@ struct ProducerConsumerQueue {
// (No real synchronization needed at destructor time: only one // (No real synchronization needed at destructor time: only one
// thread can be doing this.) // thread can be doing this.)
if (!std::is_trivially_destructible<T>::value) { if (!std::is_trivially_destructible<T>::value) {
size_t read = readIndex_; size_t readIndex = readIndex_;
size_t end = writeIndex_; size_t endIndex = writeIndex_;
while (read != end) { while (readIndex != endIndex) {
records_[read].~T(); records_[readIndex].~T();
if (++read == size_) { if (++readIndex == size_) {
read = 0; readIndex = 0;
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment