diff --git a/Userland/Libraries/LibCore/IODevice.cpp b/Userland/Libraries/LibCore/IODevice.cpp index 21bb4f3dfd..6cb4c35975 100644 --- a/Userland/Libraries/LibCore/IODevice.cpp +++ b/Userland/Libraries/LibCore/IODevice.cpp @@ -111,8 +111,6 @@ bool IODevice::can_read_line() const if (m_buffered_data.contains_in_range('\n', previous_buffer_size, new_buffer_size - 1)) return true; } - - return true; } bool IODevice::can_read() const diff --git a/Userland/Libraries/LibGL/Tex/Sampler2D.cpp b/Userland/Libraries/LibGL/Tex/Sampler2D.cpp index dbe8a4dd1b..8a167d78c6 100644 --- a/Userland/Libraries/LibGL/Tex/Sampler2D.cpp +++ b/Userland/Libraries/LibGL/Tex/Sampler2D.cpp @@ -43,7 +43,6 @@ static constexpr float wrap(float value, GLint mode) case GL_MIRRORED_REPEAT: return wrap_mirrored_repeat(value); - break; default: VERIFY_NOT_REACHED(); diff --git a/Userland/Libraries/LibGUI/TextDocument.cpp b/Userland/Libraries/LibGUI/TextDocument.cpp index db5f0d4231..c5fd0d79e9 100644 --- a/Userland/Libraries/LibGUI/TextDocument.cpp +++ b/Userland/Libraries/LibGUI/TextDocument.cpp @@ -865,8 +865,6 @@ bool RemoveTextCommand::merge_with(GUI::Command const& other) m_text = builder.to_string(); m_range.set_start(typed_other.m_range.start()); return true; - - return false; } void RemoveTextCommand::redo() diff --git a/Userland/Libraries/LibGfx/DDSLoader.cpp b/Userland/Libraries/LibGfx/DDSLoader.cpp index a6e5041fdd..d46aea7f7e 100644 --- a/Userland/Libraries/LibGfx/DDSLoader.cpp +++ b/Userland/Libraries/LibGfx/DDSLoader.cpp @@ -784,7 +784,8 @@ static bool decode_dds(DDSLoadingContext& context) return false; } - for (size_t mipmap_level = 0; mipmap_level < max(context.header.mip_map_count, 1u); mipmap_level++) { + // We support parsing mipmaps, but we only care about the largest one :^) (At least for now) + if (size_t mipmap_level = 0; mipmap_level < max(context.header.mip_map_count, 1u)) { u64 width = get_width(context.header, mipmap_level); u64 height = get_height(context.header, mipmap_level); @@ -795,9 +796,6 @@ static bool decode_dds(DDSLoadingContext& context) context.bitmap = Bitmap::try_create(BitmapFormat::BGRA8888, { width, height }); decode_bitmap(stream, context, format, width, height); - - // We support parsing mipmaps, but we only care about the largest one :^) (At least for now) - break; } context.state = DDSLoadingContext::State::BitmapDecoded; diff --git a/Userland/Libraries/LibJS/Lexer.cpp b/Userland/Libraries/LibJS/Lexer.cpp index 0977954605..cd7df4816b 100644 --- a/Userland/Libraries/LibJS/Lexer.cpp +++ b/Userland/Libraries/LibJS/Lexer.cpp @@ -847,8 +847,6 @@ Token Lexer::force_slash_as_regex() TokenType Lexer::consume_regex_literal() { - TokenType token_type = TokenType::RegexLiteral; - while (!is_eof()) { if (is_line_terminator() || (!m_regex_is_in_character_class && m_current_char == '/')) { break; @@ -868,10 +866,9 @@ TokenType Lexer::consume_regex_literal() if (m_current_char == '/') { consume(); return TokenType::RegexLiteral; - } else { - return TokenType::UnterminatedRegexLiteral; } - return token_type; + + return TokenType::UnterminatedRegexLiteral; } } diff --git a/Userland/Libraries/LibLine/Editor.cpp b/Userland/Libraries/LibLine/Editor.cpp index cf12d021c4..c55c70e08e 100644 --- a/Userland/Libraries/LibLine/Editor.cpp +++ b/Userland/Libraries/LibLine/Editor.cpp @@ -986,7 +986,7 @@ void Editor::handle_read_event() dbgln("LibLine: Unhandled final: {:02x} ({:c})", code_point, code_point); continue; } - break; + VERIFY_NOT_REACHED(); } case InputState::Verbatim: m_state = InputState::Free; diff --git a/Userland/Libraries/LibSQL/Database.cpp b/Userland/Libraries/LibSQL/Database.cpp index 1854dd4cd7..23f7774b42 100644 --- a/Userland/Libraries/LibSQL/Database.cpp +++ b/Userland/Libraries/LibSQL/Database.cpp @@ -163,7 +163,6 @@ bool Database::update(Row& tuple) return m_serializer.serialize_and_write(tuple, tuple.pointer()); // TODO update indexes defined on table. - return true; } } diff --git a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp index 3c5f8f5b3a..a20dc20391 100644 --- a/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Userland/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -1881,10 +1881,8 @@ Optional Parser::try_parse_float(StringView string) continue; } - if (str[i] < '0' || str[i] > '9' || exp_val != 0) { + if (str[i] < '0' || str[i] > '9' || exp_val != 0) return {}; - continue; - } if (is_fractional) { fraction *= 10; diff --git a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp index 40c940acc6..400aa7ed63 100644 --- a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp +++ b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp @@ -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; diff --git a/Userland/Libraries/LibWeb/Layout/TextNode.cpp b/Userland/Libraries/LibWeb/Layout/TextNode.cpp index 3354c630b4..76dc291508 100644 --- a/Userland/Libraries/LibWeb/Layout/TextNode.cpp +++ b/Userland/Libraries/LibWeb/Layout/TextNode.cpp @@ -61,7 +61,7 @@ void TextNode::paint_text_decoration(Gfx::Painter& painter, LineBoxFragment cons line_start_point = fragment_box.top_left().translated(0, baseline - x_height / 2); line_end_point = fragment_box.top_right().translated(0, baseline - x_height / 2); break; - } break; + } case CSS::TextDecorationLine::Blink: // Conforming user agents may simply not blink the text return;