Skip to content

Commit 0a17d62

Browse files
return the span on pop
1 parent 4168b34 commit 0a17d62

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

platform/include/platform/CircularBuffer.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -263,15 +263,14 @@ class CircularBuffer {
263263
/**
264264
* Pop multiple elements from the buffer.
265265
*
266-
* @param dest The array which will receive the elements.
266+
* @param dest The span that contains the buffer that will be used to store the elements.
267267
*
268-
* @return The number of elements popped.
268+
* @return The span with the size set to number of elements popped using the buffer passed in as the parameter.
269269
*/
270-
CounterType pop(mbed::Span<T>& dest)
270+
mbed::Span<T> pop(mbed::Span<T>& dest)
271271
{
272272
CounterType popped = pop(dest.data(), dest.size());
273-
dest = mbed::make_Span(dest.data(), popped);
274-
return popped;
273+
return mbed::make_Span(dest.data(), popped);
275274
}
276275

277276
/** Check if the buffer is empty.

0 commit comments

Comments
 (0)