Remove redundant is_valid checks before adding an identifier as dependency.

This commit is contained in:
levlam 2023-12-04 22:18:08 +03:00
parent f08b63268a
commit 4ac5708135
3 changed files with 3 additions and 7 deletions

View File

@ -4552,9 +4552,7 @@ void add_formatted_text_dependencies(Dependencies &dependencies, const Formatted
return;
}
for (auto &entity : text->entities) {
if (entity.user_id.is_valid()) {
dependencies.add(entity.user_id);
}
dependencies.add(entity.user_id);
}
}

View File

@ -16688,7 +16688,7 @@ void MessagesManager::load_dialogs(vector<DialogId> dialog_ids, Promise<vector<D
Dependencies dependencies;
for (auto dialog_id : dialog_ids) {
if (dialog_id.is_valid() && !have_dialog(dialog_id)) {
if (!have_dialog(dialog_id)) {
dependencies.add_dialog_dependencies(dialog_id);
}
}

View File

@ -1173,9 +1173,7 @@ void add_reply_markup_dependencies(Dependencies &dependencies, const ReplyMarkup
}
for (auto &row : reply_markup->inline_keyboard) {
for (auto &button : row) {
if (button.user_id.is_valid()) {
dependencies.add(button.user_id);
}
dependencies.add(button.user_id);
}
}
}