Skip to content

Commit 97cf138

Browse files
committed
Update on "Fix missing move and bare new in pytree from_str_internal"
Just a couple minor fixes. Differential Revision: [D65576543](https://our.internmc.facebook.com/intern/diff/D65576543/) [ghstack-poisoned]
2 parents 739c75e + b45c0a3 commit 97cf138

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

extension/pytree/pytree.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ using KeyInt = int32_t;
5555

5656
struct Key {
5757
enum class Kind : uint8_t { None, Int, Str } kind_;
58+
5859
private:
5960
std::variant<std::monostate, KeyInt, KeyStr> repr_;
6061

@@ -138,7 +139,8 @@ struct ContainerHandle {
138139

139140
/*implicit*/ ContainerHandle(container_type* c) : handle(c) {}
140141

141-
/*implicit*/ ContainerHandle(std::unique_ptr<container_type> c) : handle(std::move(c)) {}
142+
/*implicit*/ ContainerHandle(std::unique_ptr<container_type> c)
143+
: handle(std::move(c)) {}
142144

143145
void set_leaf(leaf_type* leaf) {
144146
pytree_assert(handle->kind == Kind::Leaf);
@@ -550,7 +552,7 @@ TreeSpec<Aux> from_str_internal(
550552
read_idx++;
551553
}
552554
c->leaves_num = leaves_offset;
553-
return c;
555+
return TreeSpec<Aux>(std::move(c));
554556
}
555557

556558
case Config::kLeaf:

0 commit comments

Comments
 (0)