diff options
author | max42 <max42@yandex-team.ru> | 2022-02-10 16:47:51 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:47:51 +0300 |
commit | 9988f7c537b40605e1a0aaae2977d5f540425b83 (patch) | |
tree | a4f3497f66e2dcd82d0f7ae7573acd1320d1bc78 /library/cpp/yt/misc | |
parent | 0a579de32b745908473b2cea7c5cd5540bc801f0 (diff) | |
download | ydb-9988f7c537b40605e1a0aaae2977d5f540425b83.tar.gz |
Restoring authorship annotation for <max42@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/yt/misc')
-rw-r--r-- | library/cpp/yt/misc/guid.cpp | 36 | ||||
-rw-r--r-- | library/cpp/yt/misc/guid.h | 12 | ||||
-rw-r--r-- | library/cpp/yt/misc/port.h | 8 |
3 files changed, 28 insertions, 28 deletions
diff --git a/library/cpp/yt/misc/guid.cpp b/library/cpp/yt/misc/guid.cpp index 882787d7a2b..025afa85dd2 100644 --- a/library/cpp/yt/misc/guid.cpp +++ b/library/cpp/yt/misc/guid.cpp @@ -99,22 +99,22 @@ bool TGuid::FromString(TStringBuf str, TGuid* result) return true; } -TGuid TGuid::FromStringHex32(TStringBuf str) -{ - TGuid guid; - if (!FromStringHex32(str, &guid)) { +TGuid TGuid::FromStringHex32(TStringBuf str) +{ + TGuid guid; + if (!FromStringHex32(str, &guid)) { throw TSimpleException(Sprintf("Error parsing Hex32 GUID \"%s\"", TString(str).c_str())); - } - return guid; -} - -bool TGuid::FromStringHex32(TStringBuf str, TGuid* result) -{ - if (str.size() != 32) { - return false; - } - + } + return guid; +} + +bool TGuid::FromStringHex32(TStringBuf str, TGuid* result) +{ + if (str.size() != 32) { + return false; + } + bool ok = true; int i = 0; auto parseChar = [&] { @@ -134,11 +134,11 @@ bool TGuid::FromStringHex32(TStringBuf str, TGuid* result) for (size_t j = 0; j < 16; ++j) { result->ReversedParts8[15 - j] = parseChar() * 16 + parseChar(); - } - + } + return ok; -} - +} + char* WriteGuidToBuffer(char* ptr, TGuid value) { auto writeHex1 = [&] (ui8 x) { diff --git a/library/cpp/yt/misc/guid.h b/library/cpp/yt/misc/guid.h index ec4ba3526af..303b6c31e78 100644 --- a/library/cpp/yt/misc/guid.h +++ b/library/cpp/yt/misc/guid.h @@ -70,12 +70,12 @@ struct TGuid //! Parses guid from TStringBuf, returns |true| if everything was ok. static bool FromString(TStringBuf str, TGuid* guid); - - //! Same as FromString, but expects exactly 32 hex digits without dashes. - static TGuid FromStringHex32(TStringBuf str); - - //! Same as TryFromString, but expects exactly 32 hex digits without dashes. - static bool FromStringHex32(TStringBuf str, TGuid* guid); + + //! Same as FromString, but expects exactly 32 hex digits without dashes. + static TGuid FromStringHex32(TStringBuf str); + + //! Same as TryFromString, but expects exactly 32 hex digits without dashes. + static bool FromStringHex32(TStringBuf str, TGuid* guid); }; bool operator == (TGuid lhs, TGuid rhs); diff --git a/library/cpp/yt/misc/port.h b/library/cpp/yt/misc/port.h index b24ac509959..88f5b8930ae 100644 --- a/library/cpp/yt/misc/port.h +++ b/library/cpp/yt/misc/port.h @@ -11,10 +11,10 @@ // various insightful information on memory usage and object creation patterns. #define YT_ENABLE_REF_COUNTED_TRACKING -// This define enables logging with TRACE level. You can still disable trace logging -// for particular TU by discarding this macro identifier. -#define YT_ENABLE_TRACE_LOGGING - +// This define enables logging with TRACE level. You can still disable trace logging +// for particular TU by discarding this macro identifier. +#define YT_ENABLE_TRACE_LOGGING + #ifndef NDEBUG // This define enables thread affinity check -- a user-defined verification ensuring // that some functions are called from particular threads. |