diff --git a/sdk/test/common/circular_buffer_test.cc b/sdk/test/common/circular_buffer_test.cc index 11e64a65b5..a20c3e42aa 100644 --- a/sdk/test/common/circular_buffer_test.cc +++ b/sdk/test/common/circular_buffer_test.cc @@ -59,12 +59,11 @@ void RunNumberConsumer(CircularBuffer &buffer, { while (true) { - auto allotment = buffer.Peek(); - if (exit && allotment.empty()) + if (exit && buffer.Peek().empty()) { return; } - auto n = std::uniform_int_distribution{0, allotment.size()}(RandomNumberGenerator); + auto n = std::uniform_int_distribution{0, buffer.Peek().size()}(RandomNumberGenerator); buffer.Consume(n, [&](CircularBufferRange> range) noexcept { assert(range.size() == n); range.ForEach([&](AtomicUniquePtr &ptr) noexcept {