diff options
author | Ilnur Khuziev <ilnur.khuziev@yandex.ru> | 2022-02-10 16:46:14 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:14 +0300 |
commit | 60040c91ffe701a84689b2c6310ff845e65cff42 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /library/cpp/yson/node | |
parent | 736dcd8ca259457a136f2f9f9168c44643914323 (diff) | |
download | ydb-60040c91ffe701a84689b2c6310ff845e65cff42.tar.gz |
Restoring authorship annotation for Ilnur Khuziev <ilnur.khuziev@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/yson/node')
-rw-r--r-- | library/cpp/yson/node/node.cpp | 4 | ||||
-rw-r--r-- | library/cpp/yson/node/node.h | 26 | ||||
-rw-r--r-- | library/cpp/yson/node/node_io.cpp | 6 | ||||
-rw-r--r-- | library/cpp/yson/node/node_ut.cpp | 2 |
4 files changed, 19 insertions, 19 deletions
diff --git a/library/cpp/yson/node/node.cpp b/library/cpp/yson/node/node.cpp index 5f0a956096..b39e070718 100644 --- a/library/cpp/yson/node/node.cpp +++ b/library/cpp/yson/node/node.cpp @@ -123,7 +123,7 @@ TNode::TNode(int i) TNode::TNode(unsigned int ui) : Value_(static_cast<ui64>(ui)) { } - + TNode::TNode(long i) : Value_(static_cast<i64>(i)) { } @@ -849,7 +849,7 @@ void TNode::CreateAttributes() Attributes_ = MakeHolder<TNode>(); Attributes_->Value_ = TMapType(); } - + void TNode::Save(IOutputStream* out) const { NodeToYsonStream(*this, out, NYson::EYsonFormat::Binary); diff --git a/library/cpp/yson/node/node.h b/library/cpp/yson/node/node.h index c06d8e6070..5f90f95df0 100644 --- a/library/cpp/yson/node/node.h +++ b/library/cpp/yson/node/node.h @@ -79,21 +79,21 @@ public: TNode(TString s); TNode(int i); - //this case made speccially for prevent mess cast of EType into TNode through TNode(int) constructor + //this case made speccially for prevent mess cast of EType into TNode through TNode(int) constructor //usual case of error SomeNode == TNode::Undefined <-- SomeNode indeed will be compared with TNode(0) without this method //correct way is SomeNode.GetType() == TNode::Undefined - template<class T = EType> - Y_FORCE_INLINE TNode(EType) - { - static_assert(!std::is_same<T, EType>::value, "looks like a mistake, may be you forget .GetType()"); - } - - //this case made speccially for prevent mess cast of T* into TNode through implicit bool ctr - template<class T = int> - Y_FORCE_INLINE TNode(const T*) : TNode() { - static_assert(!std::is_same<T,T>::value, "looks like a mistake, and pointer have converted to bool"); - } - + template<class T = EType> + Y_FORCE_INLINE TNode(EType) + { + static_assert(!std::is_same<T, EType>::value, "looks like a mistake, may be you forget .GetType()"); + } + + //this case made speccially for prevent mess cast of T* into TNode through implicit bool ctr + template<class T = int> + Y_FORCE_INLINE TNode(const T*) : TNode() { + static_assert(!std::is_same<T,T>::value, "looks like a mistake, and pointer have converted to bool"); + } + TNode(unsigned int ui); TNode(long i); TNode(unsigned long ui); diff --git a/library/cpp/yson/node/node_io.cpp b/library/cpp/yson/node/node_io.cpp index 443ba2cf1d..294a7f7217 100644 --- a/library/cpp/yson/node/node_io.cpp +++ b/library/cpp/yson/node/node_io.cpp @@ -134,9 +134,9 @@ TNode NodeFromJsonString(const TStringBuf input) TNodeBuilder builder(&result); TYson2JsonCallbacksAdapter callbacks(&builder, /*throwException*/ true); - NJson::TJsonReaderConfig config; - config.DontValidateUtf8 = true; - NJson::ReadJson(&stream, &config, &callbacks); + NJson::TJsonReaderConfig config; + config.DontValidateUtf8 = true; + NJson::ReadJson(&stream, &config, &callbacks); return result; } diff --git a/library/cpp/yson/node/node_ut.cpp b/library/cpp/yson/node/node_ut.cpp index de9cf702ea..448e99f575 100644 --- a/library/cpp/yson/node/node_ut.cpp +++ b/library/cpp/yson/node/node_ut.cpp @@ -1,7 +1,7 @@ #include "node.h" #include "node_io.h" -#include <library/cpp/testing/unittest/registar.h> +#include <library/cpp/testing/unittest/registar.h> #include <util/ysaveload.h> |