Assistant: Use static_cast instead of dynamic_cast

When the type is guaranteed to be known, there's no need to use RTTI.
This commit is contained in:
Andreas Kling 2021-06-30 11:44:52 +02:00
commit 80cf8bb27c
Notes: sideshowbarker 2024-07-18 11:12:58 +09:00

View file

@ -206,7 +206,7 @@ int main(int argc, char** argv)
auto mark_selected_item = [&]() { auto mark_selected_item = [&]() {
for (size_t i = 0; i < app_state.visible_result_count; ++i) { 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); row.set_is_highlighted(i == app_state.selected_index);
} }
}; };