diff --git a/Libraries/LibWeb/Painting/DisplayList.cpp b/Libraries/LibWeb/Painting/DisplayList.cpp index 70f3751cb4a..b5644dcb769 100644 --- a/Libraries/LibWeb/Painting/DisplayList.cpp +++ b/Libraries/LibWeb/Painting/DisplayList.cpp @@ -43,10 +43,9 @@ void DisplayListPlayer::execute(DisplayList& display_list) VERIFY(m_surface); - size_t next_command_index = 0; - while (next_command_index < commands.size()) { - auto scroll_frame_id = commands[next_command_index].scroll_frame_id; - auto command = commands[next_command_index++].command; + for (size_t command_index = 0; command_index < commands.size(); command_index++) { + auto scroll_frame_id = commands[command_index].scroll_frame_id; + auto command = commands[command_index].command; if (command.has()) { auto& paint_scroll_bar = command.get();