mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
Libraries: Fix -Wunreachable-code warnings from clang
This commit is contained in:
parent
96666f3209
commit
b8dc3661ac
Notes:
sideshowbarker
2024-07-18 02:54:35 +09:00
Author: https://github.com/nico
Commit: b8dc3661ac
Pull-request: https://github.com/SerenityOS/serenity/pull/10399
10 changed files with 7 additions and 27 deletions
|
@ -30,27 +30,20 @@ static bool matches_attribute(CSS::Selector::SimpleSelector::Attribute const& at
|
|||
switch (attribute.match_type) {
|
||||
case CSS::Selector::SimpleSelector::Attribute::MatchType::HasAttribute:
|
||||
return element.has_attribute(attribute.name);
|
||||
break;
|
||||
case CSS::Selector::SimpleSelector::Attribute::MatchType::ExactValueMatch:
|
||||
return element.attribute(attribute.name) == attribute.value;
|
||||
break;
|
||||
case CSS::Selector::SimpleSelector::Attribute::MatchType::ContainsWord:
|
||||
return element.attribute(attribute.name).split_view(' ').contains_slow(attribute.value);
|
||||
break;
|
||||
case CSS::Selector::SimpleSelector::Attribute::MatchType::ContainsString:
|
||||
return element.attribute(attribute.name).contains(attribute.value);
|
||||
break;
|
||||
case CSS::Selector::SimpleSelector::Attribute::MatchType::StartsWithSegment: {
|
||||
auto segments = element.attribute(attribute.name).split_view('-');
|
||||
return !segments.is_empty() && segments.first() == attribute.value;
|
||||
break;
|
||||
}
|
||||
case CSS::Selector::SimpleSelector::Attribute::MatchType::StartsWithString:
|
||||
return element.attribute(attribute.name).starts_with(attribute.value);
|
||||
break;
|
||||
case CSS::Selector::SimpleSelector::Attribute::MatchType::EndsWithString:
|
||||
return element.attribute(attribute.name).ends_with(attribute.value);
|
||||
break;
|
||||
case CSS::Selector::SimpleSelector::Attribute::MatchType::None:
|
||||
VERIFY_NOT_REACHED();
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue