aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/misc/guid.cpp
diff options
context:
space:
mode:
authormax42 <max42@yandex-team.ru>2022-02-10 16:47:51 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:51 +0300
commit884333bd8b9068bc6b852b948e9d8f23fd393ab7 (patch)
treec0748b5dcbade83af788c0abfa89c0383d6b779c /library/cpp/yt/misc/guid.cpp
parent9988f7c537b40605e1a0aaae2977d5f540425b83 (diff)
downloadydb-884333bd8b9068bc6b852b948e9d8f23fd393ab7.tar.gz
Restoring authorship annotation for <max42@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/yt/misc/guid.cpp')
-rw-r--r--library/cpp/yt/misc/guid.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/library/cpp/yt/misc/guid.cpp b/library/cpp/yt/misc/guid.cpp
index 025afa85dd2..882787d7a2b 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) {