Skip to content
Snippets Groups Projects
Commit fe1cf209 authored by Nicolas's avatar Nicolas Committed by GitHub
Browse files

Merge pull request #93 from sim590/select-consistency

dht: return consistent query from local storage
parents 0d754d6c 2f72563b
Branches
Tags
No related merge requests found
...@@ -1681,8 +1681,8 @@ void Dht::query(const InfoHash& id, QueryCallback cb, DoneCallback done_cb, Quer ...@@ -1681,8 +1681,8 @@ void Dht::query(const InfoHash& id, QueryCallback cb, DoneCallback done_cb, Quer
return newvals; return newvals;
}; };
std::vector<std::shared_ptr<FieldValueIndex>> local_fields(values.size()); std::vector<std::shared_ptr<FieldValueIndex>> local_fields(values.size());
std::transform(values.begin(), values.end(), local_fields.begin(), [](const std::shared_ptr<Value>& v) { std::transform(values.begin(), values.end(), local_fields.begin(), [&q](const std::shared_ptr<Value>& v) {
return std::make_shared<FieldValueIndex>(*v); return std::make_shared<FieldValueIndex>(*v, q.select);
}); });
auto qcb = std::bind(callbackWrapper<FieldValueIndex, QueryCallback>, cb, done_cb, _1, add_fields, op); auto qcb = std::bind(callbackWrapper<FieldValueIndex, QueryCallback>, cb, done_cb, _1, add_fields, op);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment