mirror of
https://github.com/typesense/typesense.git
synced 2025-05-23 15:23:40 +08:00
Refactor type definition of art node priority queue comparator.
This commit is contained in:
parent
6ad5e36179
commit
5a3482435b
@ -905,15 +905,11 @@ int art_topk_iter(const art_node *root, token_ordering token_order, size_t max_r
|
||||
std::vector<art_leaf *> &results) {
|
||||
printf("INSIDE art_topk_iter: root->type: %d\n", root->type);
|
||||
|
||||
std::priority_queue<art_node *, std::vector<const art_node *>,
|
||||
std::function<bool(const art_node*, const art_node*)>> q;
|
||||
std::priority_queue<art_node *, std::vector<const art_node *>, decltype(&compare_art_node_score_pq)> q;
|
||||
|
||||
if(token_order == FREQUENCY) {
|
||||
q = std::priority_queue<art_node *, std::vector<const art_node *>,
|
||||
std::function<bool(const art_node*, const art_node*)>>(compare_art_node_frequency_pq);
|
||||
} else {
|
||||
q = std::priority_queue<art_node *, std::vector<const art_node *>,
|
||||
std::function<bool(const art_node*, const art_node*)>>(compare_art_node_score_pq);
|
||||
decltype(&compare_art_node_frequency_pq)>(compare_art_node_frequency_pq);
|
||||
}
|
||||
|
||||
q.push(root);
|
||||
|
Loading…
x
Reference in New Issue
Block a user