diff options
| author | vladluk <[email protected]> | 2025-10-07 12:07:58 +0300 |
|---|---|---|
| committer | vladluk <[email protected]> | 2025-10-07 12:36:53 +0300 |
| commit | 9c340580c2208cf5c87fa0a172ed96a77ac59017 (patch) | |
| tree | 69625a7751d57972131685503fc369775ec5155d /library/cpp/yson/node/node_builder.h | |
| parent | c0755de13ad9afe55f0ecd576f5fc7dc1ad3239c (diff) | |
TNode emplace construction experiment
commit_hash:ab793ace85a103212627c3a34df3b7d75e25eff8
Diffstat (limited to 'library/cpp/yson/node/node_builder.h')
| -rw-r--r-- | library/cpp/yson/node/node_builder.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/library/cpp/yson/node/node_builder.h b/library/cpp/yson/node/node_builder.h index 13d2b5e4f5e..293a314d141 100644 --- a/library/cpp/yson/node/node_builder.h +++ b/library/cpp/yson/node/node_builder.h @@ -40,7 +40,12 @@ private: TStack<TNode*> Stack_; private: - inline void AddNode(TNode node, bool pop); + template <typename T> + inline void AddNode(T value, bool pop) { + Stack_.top()->MoveWithoutAttributes(std::move(value)); + if (pop) + Stack_.pop(); + } }; //////////////////////////////////////////////////////////////////////////////// |
