Skip to content

Commit

Permalink
Assistant: Use static_cast instead of dynamic_cast
Browse files Browse the repository at this point in the history
When the type is guaranteed to be known, there's no need to use RTTI.
  • Loading branch information
awesomekling committed Jun 30, 2021
1 parent 6c63043 commit 80cf8bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Userland/Applications/Assistant/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ int main(int argc, char** argv)

auto mark_selected_item = [&]() {
for (size_t i = 0; i < app_state.visible_result_count; ++i) {
auto& row = dynamic_cast<Assistant::ResultRow&>(results_container.child_widgets()[i]);
auto& row = static_cast<Assistant::ResultRow&>(results_container.child_widgets()[i]);
row.set_is_highlighted(i == app_state.selected_index);
}
};
Expand Down

0 comments on commit 80cf8bb

Please sign in to comment.