aboutsummaryrefslogtreecommitdiffstats
path: root/util/stream
diff options
context:
space:
mode:
authorkulikov <kulikov@yandex-team.ru>2022-02-10 16:49:34 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:34 +0300
commitc707901605d7b7c6cba0998cd52e1ae619c97762 (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /util/stream
parent65e5266709e7ff94b14ae128309e229de714b0df (diff)
downloadydb-c707901605d7b7c6cba0998cd52e1ae619c97762.tar.gz
Restoring authorship annotation for <kulikov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/stream')
-rw-r--r--util/stream/buffered.cpp6
-rw-r--r--util/stream/ios_ut.cpp16
-rw-r--r--util/stream/tokenizer.h6
-rw-r--r--util/stream/zerocopy.cpp8
4 files changed, 18 insertions, 18 deletions
diff --git a/util/stream/buffered.cpp b/util/stream/buffered.cpp
index 6c8519bdfe..a00e592e1c 100644
--- a/util/stream/buffered.cpp
+++ b/util/stream/buffered.cpp
@@ -71,13 +71,13 @@ public:
while (true) {
if (MemInput_.Exhausted()) {
- const size_t bytesRead = Slave_->Read(Buf(), BufLen());
+ const size_t bytesRead = Slave_->Read(Buf(), BufLen());
- if (!bytesRead) {
+ if (!bytesRead) {
break;
}
- MemInput_.Reset(Buf(), bytesRead);
+ MemInput_.Reset(Buf(), bytesRead);
}
const size_t a_len(MemInput_.Avail());
diff --git a/util/stream/ios_ut.cpp b/util/stream/ios_ut.cpp
index 9db05b9fba..139f4296e5 100644
--- a/util/stream/ios_ut.cpp
+++ b/util/stream/ios_ut.cpp
@@ -261,21 +261,21 @@ void TStreamsTest::TestBufferStream() {
stream.Write(s.data(), s.size());
char buf[5];
- size_t bytesRead = stream.Read(buf, 4);
- UNIT_ASSERT_EQUAL(4, bytesRead);
+ size_t bytesRead = stream.Read(buf, 4);
+ UNIT_ASSERT_EQUAL(4, bytesRead);
UNIT_ASSERT_EQUAL(0, strncmp(s.data(), buf, 4));
stream.Write(s.data(), s.size());
- bytesRead = stream.Read(buf, 2);
- UNIT_ASSERT_EQUAL(2, bytesRead);
+ bytesRead = stream.Read(buf, 2);
+ UNIT_ASSERT_EQUAL(2, bytesRead);
UNIT_ASSERT_EQUAL(0, strncmp("te", buf, 2));
- bytesRead = stream.Read(buf, 2);
- UNIT_ASSERT_EQUAL(2, bytesRead);
+ bytesRead = stream.Read(buf, 2);
+ UNIT_ASSERT_EQUAL(2, bytesRead);
UNIT_ASSERT_EQUAL(0, strncmp("st", buf, 2));
- bytesRead = stream.Read(buf, 2);
- UNIT_ASSERT_EQUAL(0, bytesRead);
+ bytesRead = stream.Read(buf, 2);
+ UNIT_ASSERT_EQUAL(0, bytesRead);
}
namespace {
diff --git a/util/stream/tokenizer.h b/util/stream/tokenizer.h
index 41f5f2a76d..b2398efdd1 100644
--- a/util/stream/tokenizer.h
+++ b/util/stream/tokenizer.h
@@ -173,11 +173,11 @@ public:
private:
inline size_t Fill() {
const size_t avail = BufEnd() - End_;
- const size_t bytesRead = Input_->Read(End_, avail);
+ const size_t bytesRead = Input_->Read(End_, avail);
- End_ += bytesRead;
+ End_ += bytesRead;
- return bytesRead;
+ return bytesRead;
}
inline char* BufBegin() noexcept {
diff --git a/util/stream/zerocopy.cpp b/util/stream/zerocopy.cpp
index be27642733..dc2982ad55 100644
--- a/util/stream/zerocopy.cpp
+++ b/util/stream/zerocopy.cpp
@@ -44,12 +44,12 @@ size_t IZeroCopyInputFastReadTo::DoReadTo(TString& st, char ch) {
st.clear();
do {
if (const char* pos = (const char*)memchr(ptr, ch, len)) {
- size_t bytesRead = (pos - ptr) + 1;
- if (bytesRead > 1) {
+ size_t bytesRead = (pos - ptr) + 1;
+ if (bytesRead > 1) {
st.append(ptr, pos);
}
- Undo(len - bytesRead);
- result += bytesRead;
+ Undo(len - bytesRead);
+ result += bytesRead;
return result;
} else {
result += len;