Skip to content

Commit

Permalink
buffer: make iterator copy to ptr handle len==0
Browse files Browse the repository at this point in the history
Signed-off-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed Oct 16, 2016
1 parent b00b9d0 commit e7155b3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/common/buffer.cc
Expand Up @@ -1163,6 +1163,9 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
template<bool is_const>
void buffer::list::iterator_impl<is_const>::copy_deep(unsigned len, ptr &dest)
{
if (!len) {
return;
}
if (p == ls->end())
throw end_of_buffer();
assert(p->length() > 0);
Expand All @@ -1173,6 +1176,9 @@ static simple_spinlock_t buffer_debug_lock = SIMPLE_SPINLOCK_INITIALIZER;
void buffer::list::iterator_impl<is_const>::copy_shallow(unsigned len,
ptr &dest)
{
if (!len) {
return;
}
if (p == ls->end())
throw end_of_buffer();
assert(p->length() > 0);
Expand Down

0 comments on commit e7155b3

Please sign in to comment.