Remove redundant is_valid checks before adding an identifier as dependency.
This commit is contained in:
parent
f08b63268a
commit
4ac5708135
@ -4552,10 +4552,8 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool has_media_timestamps(const FormattedText *text, int32 min_media_timestamp, int32 max_media_timestamp) {
|
||||
|
@ -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,11 +1173,9 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace td
|
||||
|
Loading…
Reference in New Issue
Block a user