2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-03 07:56:03 +00:00

Simplified ranges::find_if with ranges::any_of and ranges::none_of.

This commit is contained in:
23rd
2020-05-18 22:33:14 +03:00
committed by John Preston
parent 5f238a71f9
commit e318a7d65f
33 changed files with 71 additions and 105 deletions

View File

@@ -271,14 +271,14 @@ bool ServiceCheck::checkRippleStartPosition(QPoint position) const {
if (slug.isEmpty() || slug.size() > kMaxWallPaperSlugLength) {
return false;
}
return ranges::find_if(slug, [](QChar ch) {
return ranges::none_of(slug, [](QChar ch) {
return (ch != '.')
&& (ch != '_')
&& (ch != '-')
&& (ch < '0' || ch > '9')
&& (ch < 'a' || ch > 'z')
&& (ch < 'A' || ch > 'Z');
}) == slug.end();
});
}
AdminLog::OwnedItem GenerateTextItem(