Fix g++4.9 compilation errors.
This commit is contained in:
parent
1d3cf2c209
commit
4f8cfce082
@ -173,8 +173,8 @@ void FileReferenceManager::merge(NodeId to_node_id, NodeId from_node_id) {
|
|||||||
auto &from = from_it->second;
|
auto &from = from_it->second;
|
||||||
VLOG(file_references) << "Merge " << to.file_source_ids.size() << " and " << from.file_source_ids.size()
|
VLOG(file_references) << "Merge " << to.file_source_ids.size() << " and " << from.file_source_ids.size()
|
||||||
<< " sources of files " << to_node_id << " and " << from_node_id;
|
<< " sources of files " << to_node_id << " and " << from_node_id;
|
||||||
CHECK(!to.query || to.query->proxy.empty());
|
CHECK(!to.query || to.query->proxy.is_empty());
|
||||||
CHECK(!from.query || from.query->proxy.empty());
|
CHECK(!from.query || from.query->proxy.is_empty());
|
||||||
if (to.query || from.query) {
|
if (to.query || from.query) {
|
||||||
if (!to.query) {
|
if (!to.query) {
|
||||||
to.query = make_unique<Query>();
|
to.query = make_unique<Query>();
|
||||||
@ -183,7 +183,7 @@ void FileReferenceManager::merge(NodeId to_node_id, NodeId from_node_id) {
|
|||||||
if (from.query) {
|
if (from.query) {
|
||||||
combine(to.query->promises, std::move(from.query->promises));
|
combine(to.query->promises, std::move(from.query->promises));
|
||||||
to.query->active_queries += from.query->active_queries;
|
to.query->active_queries += from.query->active_queries;
|
||||||
from.query->proxy = {to_node_id, to.query->generation};
|
from.query->proxy = Destination(to_node_id, to.query->generation);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
to.file_source_ids.merge(std::move(from.file_source_ids));
|
to.file_source_ids.merge(std::move(from.file_source_ids));
|
||||||
@ -225,7 +225,7 @@ void FileReferenceManager::run_node(NodeId node_id) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
auto file_source_id = node.file_source_ids.next();
|
auto file_source_id = node.file_source_ids.next();
|
||||||
send_query({node_id, node.query->generation}, file_source_id);
|
send_query(Destination(node_id, node.query->generation), file_source_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileReferenceManager::send_query(Destination dest, FileSourceId file_source_id) {
|
void FileReferenceManager::send_query(Destination dest, FileSourceId file_source_id) {
|
||||||
@ -325,7 +325,7 @@ FileReferenceManager::Destination FileReferenceManager::on_query_result(Destinat
|
|||||||
query->active_queries--;
|
query->active_queries--;
|
||||||
CHECK(query->active_queries >= 0);
|
CHECK(query->active_queries >= 0);
|
||||||
|
|
||||||
if (!query->proxy.empty()) {
|
if (!query->proxy.is_empty()) {
|
||||||
query->active_queries -= sub;
|
query->active_queries -= sub;
|
||||||
CHECK(query->active_queries >= 0);
|
CHECK(query->active_queries >= 0);
|
||||||
auto new_proxy = on_query_result(query->proxy, file_source_id, std::move(status), query->active_queries);
|
auto new_proxy = on_query_result(query->proxy, file_source_id, std::move(status), query->active_queries);
|
||||||
|
@ -76,11 +76,15 @@ class FileReferenceManager final : public Actor {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
struct Destination {
|
struct Destination {
|
||||||
bool empty() const {
|
|
||||||
return node_id.empty();
|
|
||||||
}
|
|
||||||
NodeId node_id;
|
NodeId node_id;
|
||||||
int64 generation{0};
|
int64 generation{0};
|
||||||
|
|
||||||
|
Destination() = default;
|
||||||
|
Destination(NodeId node_id, int64 generation) : node_id(node_id), generation(generation) {
|
||||||
|
}
|
||||||
|
bool is_empty() const {
|
||||||
|
return node_id.empty();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
struct Query {
|
struct Query {
|
||||||
std::vector<Promise<>> promises;
|
std::vector<Promise<>> promises;
|
||||||
|
@ -66,8 +66,8 @@ struct MessagesDbGetDialogSparseMessagePositionsQuery {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct MessagesDbMessagePosition {
|
struct MessagesDbMessagePosition {
|
||||||
int32 position{0};
|
int32 position;
|
||||||
int32 date{0};
|
int32 date;
|
||||||
MessageId message_id;
|
MessageId message_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user