From 4af565362c140194a03dda90868531e0db82e633 Mon Sep 17 00:00:00 2001 From: Sam Atkins Date: Mon, 5 Feb 2024 16:00:57 +0000 Subject: [PATCH] HexEditor: Remove redundant checks in offset_at() Neither of these is possible based on the if statement above them. --- Userland/Applications/HexEditor/HexEditor.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Userland/Applications/HexEditor/HexEditor.cpp b/Userland/Applications/HexEditor/HexEditor.cpp index b11aba9b39..112619d715 100644 --- a/Userland/Applications/HexEditor/HexEditor.cpp +++ b/Userland/Applications/HexEditor/HexEditor.cpp @@ -288,9 +288,6 @@ Optional HexEditor::offset_at(Gfx::IntPoint position) con // Hexadecimal display if (absolute_x >= hex_start_x && absolute_x <= hex_end_x && absolute_y >= hex_start_y && absolute_y <= hex_end_y) { - if (absolute_x < hex_start_x || absolute_y < hex_start_y) - return {}; - auto hex_text_start_x = hex_start_x + m_padding; auto hex_text_end_x = hex_end_x - m_padding; absolute_x = clamp(absolute_x, hex_text_start_x, hex_text_end_x); @@ -307,9 +304,6 @@ Optional HexEditor::offset_at(Gfx::IntPoint position) con // Text display if (absolute_x >= text_start_x && absolute_x <= text_end_x && absolute_y >= text_start_y && absolute_y <= text_end_y) { - if (absolute_x < hex_start_x || absolute_y < hex_start_y) - return {}; - auto text_text_start_x = text_start_x + m_padding; auto text_text_end_x = text_end_x - m_padding; absolute_x = clamp(absolute_x, text_text_start_x, text_text_end_x);