diff options
author | Ilnur Khuziev <ilnur.khuziev@yandex.ru> | 2022-02-10 16:46:13 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:13 +0300 |
commit | 736dcd8ca259457a136f2f9f9168c44643914323 (patch) | |
tree | ddd46a036d68bfa83aa11b892f31243ea6b068a1 /library/cpp/yson/node | |
parent | 9bf2fa2b060c9881d3135c2208c624a1dd546ecc (diff) | |
download | ydb-736dcd8ca259457a136f2f9f9168c44643914323.tar.gz |
Restoring authorship annotation for Ilnur Khuziev <ilnur.khuziev@yandex.ru>. Commit 1 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 b39e070718..5f0a956096 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 5f90f95df0..c06d8e6070 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 294a7f7217..443ba2cf1d 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 448e99f575..de9cf702ea 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> |