Skip to content

Commit 03464d6

Browse files
committed
fix: use ref in setTreeFiltererCandidates
1 parent 5cafb98 commit 03464d6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/fuzzaldrin.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ Napi::Value Fuzzaldrin::setTreeFiltererCandidates(const Napi::CallbackInfo &info
6464
const string childrenKey = info[2].As<Napi::String>();
6565

6666
// create Tree and set candidates
67-
_tree = Tree(jsTreeArray, dataKey, childrenKey);
67+
_tree = Tree(move_const(jsTreeArray), move_const(dataKey), move_const(childrenKey));
6868

69-
const auto &candidates = _tree.entriesArray;
69+
const auto candidates = ref(_tree.entriesArray);
7070

71-
const auto N = candidates.size();// different
71+
const auto N = candidates.get().size();// different
7272
const auto num_chunks = N < 1000 * kMaxThreads ? N / 1000 + 1 : kMaxThreads;
7373
candidates_.clear();
7474
candidates_.resize(num_chunks);
@@ -80,7 +80,7 @@ Napi::Value Fuzzaldrin::setTreeFiltererCandidates(const Napi::CallbackInfo &info
8080
chunk_size++;
8181
}
8282
for (auto j = cur_start; j < cur_start + chunk_size; j++) {
83-
candidates_[i].emplace_back(candidates[j].data);// different // TODO copy
83+
candidates_[i].emplace_back(candidates.get()[j].data);// different // TODO copy
8484
}
8585
cur_start += chunk_size;
8686
}

0 commit comments

Comments
 (0)