diff --git a/lib/include/srsran/adt/circular_buffer.h b/lib/include/srsran/adt/circular_buffer.h index e162373cf..058dda42c 100644 --- a/lib/include/srsran/adt/circular_buffer.h +++ b/lib/include/srsran/adt/circular_buffer.h @@ -533,10 +533,11 @@ public: std::swap(base_t::buffer, other.buffer); } - void set_size(size_t size) + void set_size(size_t sz) { - srsran_assert(base_t::empty(), "Dynamic resizes not supported when circular buffer is not empty"); - base_t::buffer.resize(size); + srsran_assert(base_t::empty() or sz == base_t::size(), + "Dynamic resizes not supported when circular buffer is not empty"); + base_t::buffer.resize(sz); } };