summaryrefslogtreecommitdiffstats
path: root/util/stream/tempbuf.cpp
diff options
context:
space:
mode:
authorAnton Samokhvalov <[email protected]>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /util/stream/tempbuf.cpp
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
Restoring authorship annotation for Anton Samokhvalov <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'util/stream/tempbuf.cpp')
-rw-r--r--util/stream/tempbuf.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/util/stream/tempbuf.cpp b/util/stream/tempbuf.cpp
index 801a1fabb05..50fca60be50 100644
--- a/util/stream/tempbuf.cpp
+++ b/util/stream/tempbuf.cpp
@@ -1,22 +1,22 @@
-#include "tempbuf.h"
-
-namespace {
+#include "tempbuf.h"
+
+namespace {
static inline size_t Next(size_t size) noexcept {
- return size * 2;
- }
-}
-
+ return size * 2;
+ }
+}
+
void TTempBufOutput::DoWrite(const void* data, size_t len) {
if (Y_LIKELY(len <= Left())) {
- Append(data, len);
- } else {
- const size_t filled = Filled();
-
- TTempBuf buf(Next(filled + len));
-
- buf.Append(Data(), filled);
- buf.Append(data, len);
-
- static_cast<TTempBuf&>(*this) = buf;
- }
-}
+ Append(data, len);
+ } else {
+ const size_t filled = Filled();
+
+ TTempBuf buf(Next(filled + len));
+
+ buf.Append(Data(), filled);
+ buf.Append(data, len);
+
+ static_cast<TTempBuf&>(*this) = buf;
+ }
+}