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 | fc8d3fe40009fab7705035e6ffdc3eb334307c80 (patch) | |
tree | 727a724ad16999a718de495cb330555f602cf01a /util/generic/buffer.h | |
parent | fcd93d3533aed781986b121b1362ca188bd96367 (diff) | |
download | ydb-fc8d3fe40009fab7705035e6ffdc3eb334307c80.tar.gz |
Restoring authorship annotation for <aavdonkin@yandex-team.ru>. Commit 1 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 9576467404..1753fcdd64 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_; } |