mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:37:34 +00:00
HexEditor: Remove redundant checks in offset_at()
Neither of these is possible based on the if statement above them.
This commit is contained in:
parent
ca3f21f273
commit
4af565362c
1 changed files with 0 additions and 6 deletions
|
@ -288,9 +288,6 @@ Optional<HexEditor::OffsetData> 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::OffsetData> 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue