Remove redundant is_valid checks before adding an identifier as dependency.
This commit is contained in:
parent
f08b63268a
commit
4ac5708135
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user