mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Simplified ranges::find_if with ranges::any_of and ranges::none_of.
This commit is contained in:
@@ -3822,10 +3822,7 @@ void Session::setWallpapers(const QVector<MTPWallPaper> &data, int32 hash) {
|
||||
_wallpapers.push_back(*parsed);
|
||||
}
|
||||
}
|
||||
const auto defaultFound = ranges::find_if(
|
||||
_wallpapers,
|
||||
Data::IsDefaultWallPaper);
|
||||
if (defaultFound == end(_wallpapers)) {
|
||||
if (ranges::none_of(_wallpapers, Data::IsDefaultWallPaper)) {
|
||||
_wallpapers.push_back(Data::DefaultWallPaper());
|
||||
_wallpapers.back().setLocalImageAsThumbnail(std::make_shared<Image>(
|
||||
u":/gui/arg/bg.jpg"_q));
|
||||
|
Reference in New Issue
Block a user