diff options
author | Lenny Maiorani <lenny@colorado.edu> | 2021-07-25 14:21:27 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-02 00:37:18 +0200 |
commit | a0d7640e034a5ce0dc6efabceac48d28780bc86d (patch) | |
tree | 181c187f522f03f30c4e1d03bb46e1e89add3045 /Userland/Libraries/LibWeb | |
parent | cb9de1d74199e4310ce5accfcca9ead83f45fa77 (diff) | |
download | serenity-a0d7640e034a5ce0dc6efabceac48d28780bc86d.zip |
Userland: Make use of container version of any_of
Problem:
- New `any_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.
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Element.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index a71d30bdb6..3bdd6d9aef 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -91,7 +91,7 @@ void Element::remove_attribute(const FlyString& name) bool Element::has_class(const FlyString& class_name, CaseSensitivity case_sensitivity) const { - return any_of(m_classes.begin(), m_classes.end(), [&](auto& it) { + return any_of(m_classes, [&](auto& it) { return case_sensitivity == CaseSensitivity::CaseSensitive ? it == class_name : it.to_lowercase() == class_name.to_lowercase(); |