summaryrefslogtreecommitdiffstats
path: root/util/stream/tempbuf.cpp
diff options
context:
space:
mode:
authorAnton Samokhvalov <[email protected]>2022-02-10 16:45:17 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /util/stream/tempbuf.cpp
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
Restoring authorship annotation for Anton Samokhvalov <[email protected]>. Commit 2 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 50fca60be50..801a1fabb05 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;
+ }
+}