diff options
author | aavdonkin <aavdonkin@yandex-team.ru> | 2022-02-10 16:49:57 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:57 +0300 |
commit | efc32853c4263131bc59412eaf1a9e4aaae2a1f9 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /util/generic/buffer.h | |
parent | fc8d3fe40009fab7705035e6ffdc3eb334307c80 (diff) | |
download | ydb-efc32853c4263131bc59412eaf1a9e4aaae2a1f9.tar.gz |
Restoring authorship annotation for <aavdonkin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/buffer.h')
-rw-r--r-- | util/generic/buffer.h | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/util/generic/buffer.h b/util/generic/buffer.h index 1753fcdd64..9576467404 100644 --- a/util/generic/buffer.h +++ b/util/generic/buffer.h @@ -145,12 +145,12 @@ public: } } - inline void ReserveExactNeverCallMeInSaneCode(size_t len) { - if (len > Len_) { - Realloc(len); - } - } - + inline void ReserveExactNeverCallMeInSaneCode(size_t len) { + if (len > Len_) { + Realloc(len); + } + } + inline void ShrinkToFit() { if (Pos_ < Len_) { Realloc(Pos_); @@ -162,14 +162,14 @@ public: Pos_ = len; } - // Method works like Resize, but allocates exact specified number of bytes - // rather than rounded up to next power of 2 - // Use with care - inline void ResizeExactNeverCallMeInSaneCode(size_t len) { - ReserveExactNeverCallMeInSaneCode(len); - Pos_ = len; - } - + // Method works like Resize, but allocates exact specified number of bytes + // rather than rounded up to next power of 2 + // Use with care + inline void ResizeExactNeverCallMeInSaneCode(size_t len) { + ReserveExactNeverCallMeInSaneCode(len); + Pos_ = len; + } + inline size_t Capacity() const noexcept { return Len_; } |