Skip to content

Commit

Permalink
Fix another g++4.9 compilation error.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Dec 1, 2021
1 parent 4f8cfce commit 9948677
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions td/telegram/MessagesDb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,17 +667,17 @@ class MessagesDbImpl final : public MessagesDbSyncInterface {

int32 limit = min(query.limit, static_cast<int32>(message_ids.size()));
double delta = static_cast<double>(message_ids.size()) / limit;
vector<MessagesDbMessagePosition> positions;
positions.reserve(limit);
MessagesDbMessagePositions positions;
positions.total_count = static_cast<int32>(message_ids.size());
positions.positions.reserve(limit);
for (int32 i = 0; i < limit; i++) {
auto position = static_cast<int32>((i + 0.5) * delta);
auto message_id = message_ids[position];
TRY_RESULT(message, get_message({query.dialog_id, message_id}));
auto date = get_message_info(message).second;
positions.push_back(MessagesDbMessagePosition{position, date, message_id});
positions.positions.push_back(MessagesDbMessagePosition{position, date, message_id});
}

return MessagesDbMessagePositions{static_cast<int32>(message_ids.size()), std::move(positions)};
return positions;
}

Result<vector<MessagesDbDialogMessage>> get_messages(MessagesDbMessagesQuery query) final {
Expand Down

0 comments on commit 9948677

Please sign in to comment.