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 {
// (No real synchronization needed at destructor time: only one
// thread can be doing this.)
if (!std::is_trivially_destructible<T>::value) {
size_t read = readIndex_;
size_t end = writeIndex_;
while (read != end) {
records_[read].~T();
if (++read == size_) {
read = 0;
size_t readIndex = readIndex_;
size_t endIndex = writeIndex_;
while (readIndex != endIndex) {
records_[readIndex].~T();
if (++readIndex == size_) {
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