diff options
author | a-romanov <a-romanov@yandex-team.ru> | 2022-02-10 16:48:10 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:10 +0300 |
commit | aa2986a34bde73b2cdcea5080c4443b7cf2ba686 (patch) | |
tree | 410fbde59311309b774a0da147f79628c3429a2c /util/generic/buffer.h | |
parent | e77cfd118321c5b9c168fdee41b4e6c5706b8f68 (diff) | |
download | ydb-aa2986a34bde73b2cdcea5080c4443b7cf2ba686.tar.gz |
Restoring authorship annotation for <a-romanov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/generic/buffer.h')
-rw-r--r-- | util/generic/buffer.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/util/generic/buffer.h b/util/generic/buffer.h index 9576467404..ccedad535e 100644 --- a/util/generic/buffer.h +++ b/util/generic/buffer.h @@ -106,30 +106,30 @@ public: *(Data() + Pos_++) = ch; } - void Fill(char ch, size_t len); - + void Fill(char ch, size_t len); + // Method is useful when first messages from buffer are processed, and // the last message in buffer is incomplete, so we need to move partial // message to the begin of the buffer and continue filling the buffer // from the network. - inline void Chop(size_t pos, size_t count) { - const auto end = pos + count; - Y_ASSERT(end <= Pos_); + inline void Chop(size_t pos, size_t count) { + const auto end = pos + count; + Y_ASSERT(end <= Pos_); if (count == 0) { return; } else if (count == Pos_) { Pos_ = 0; } else { - memmove(Data_ + pos, Data_ + end, Pos_ - end); - Pos_ -= count; + memmove(Data_ + pos, Data_ + end, Pos_ - end); + Pos_ -= count; } } - inline void ChopHead(size_t count) { - Chop(0U, count); - } - + inline void ChopHead(size_t count) { + Chop(0U, count); + } + inline void Proceed(size_t pos) { //Y_ASSERT(pos <= Len_); // see discussion in REVIEW:29021 Resize(pos); |