diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
commit | 9abfb1a53b7f7b791444d1378e645d8fad9b06ed (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /util/generic/yexception.cpp | |
parent | 8cbc307de0221f84c80c42dcbe07d40727537e2c (diff) | |
download | ydb-9abfb1a53b7f7b791444d1378e645d8fad9b06ed.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'util/generic/yexception.cpp')
-rw-r--r-- | util/generic/yexception.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/util/generic/yexception.cpp b/util/generic/yexception.cpp index 630aaa42e23..2ce6c4369da 100644 --- a/util/generic/yexception.cpp +++ b/util/generic/yexception.cpp @@ -75,22 +75,22 @@ void TSystemError::Init() { exc << TStringBuf(") "); } -NPrivateException::yexception::yexception() { - ZeroTerminate(); -} - -TStringBuf NPrivateException::yexception::AsStrBuf() const { - if (Buf_.Left()) { - return TStringBuf(Buf_.Data(), Buf_.Filled()); - } - - return TStringBuf(Buf_.Data(), Buf_.Filled() - 1); -} - -void NPrivateException::yexception::ZeroTerminate() noexcept { - char* end = (char*)Buf_.Current(); - - if (!Buf_.Left()) { +NPrivateException::yexception::yexception() { + ZeroTerminate(); +} + +TStringBuf NPrivateException::yexception::AsStrBuf() const { + if (Buf_.Left()) { + return TStringBuf(Buf_.Data(), Buf_.Filled()); + } + + return TStringBuf(Buf_.Data(), Buf_.Filled() - 1); +} + +void NPrivateException::yexception::ZeroTerminate() noexcept { + char* end = (char*)Buf_.Current(); + + if (!Buf_.Left()) { --end; } @@ -98,11 +98,11 @@ void NPrivateException::yexception::ZeroTerminate() noexcept { } const char* NPrivateException::yexception::what() const noexcept { - return Buf_.Data(); + return Buf_.Data(); } const TBackTrace* NPrivateException::yexception::BackTrace() const noexcept { - return nullptr; + return nullptr; } void fputs(const std::exception& e, FILE* f) { |