diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:46 +0300 |
commit | 8cbc307de0221f84c80c42dcbe07d40727537e2c (patch) | |
tree | 625d5a673015d1df891e051033e9fcde5c7be4e5 /util/generic/yexception.cpp | |
parent | 30d1ef3941e0dc835be7609de5ebee66958f215a (diff) | |
download | ydb-8cbc307de0221f84c80c42dcbe07d40727537e2c.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 1 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 2ce6c4369d..630aaa42e2 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) { |