1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:07:34 +00:00

Everywhere: Make use of container version of all_of

Problem:
- New `all_of` implementation takes the entire container so the user
  does not need to pass explicit begin/end iterators. This is unused
  except is in tests.

Solution:
- Make use of the new and more user-friendly version where possible.
This commit is contained in:
Lenny Maiorani 2021-07-25 15:05:48 -06:00 committed by Andreas Kling
parent 2c042e3530
commit 97bd13264a
10 changed files with 10 additions and 11 deletions

View file

@ -120,7 +120,7 @@ String serialize_astring(StringView string)
auto non_atom_chars = { '(', ')', '{', ' ', '%', '*', '"', '\\', ']' };
return AK::find(non_atom_chars.begin(), non_atom_chars.end(), x) != non_atom_chars.end();
};
auto is_atom = all_of(string.begin(), string.end(), [&](auto ch) { return is_ascii_control(ch) && !is_non_atom_char(ch); });
auto is_atom = all_of(string, [&](auto ch) { return is_ascii_control(ch) && !is_non_atom_char(ch); });
if (is_atom) {
return string;
}