File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ struct CandidateObject {
31
31
const size_t level = 0 ;
32
32
const size_t index = 0 ;
33
33
34
- CandidateObject (const CandidateString &data_, const size_t level_, const size_t index_) noexcept
35
- : data{ data_ }, level{ level_ }, index{ index_ } {}
34
+ CandidateObject (CandidateString & &data_, const size_t level_, const size_t index_) noexcept
35
+ : data{ move ( data_) }, level{ level_ }, index{ index_ } {}
36
36
};
37
37
38
38
template <typename T>
@@ -53,9 +53,15 @@ struct Tree {
53
53
54
54
/* * 1st argument is a single object */
55
55
void makeEntriesArray (const Napi::Object &jsTree, const size_t level, const size_t iEntry) {
56
- // get the current data
57
- const auto data = jsTree.Get (dataKey).ToString ().Utf8Value ();
58
- entriesArray.emplace_back (CandidateObject (data, level, iEntry));
56
+ // finally emplace it back
57
+ entriesArray.emplace_back (
58
+ // then make the CandidateObject
59
+ CandidateObject (
60
+ jsTree.Get (dataKey).ToString ().Utf8Value (),// first, get the current data
61
+ level,
62
+ iEntry)
63
+
64
+ );
59
65
60
66
// add children if any
61
67
auto mayChildren = getChildren (jsTree, childrenKey);
You can’t perform that action at this time.
0 commit comments