Kaynağa Gözat

Assistant: Use static_cast instead of dynamic_cast

When the type is guaranteed to be known, there's no need to use RTTI.
Andreas Kling 4 yıl önce
ebeveyn
işleme
80cf8bb27c
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      Userland/Applications/Assistant/main.cpp

+ 1 - 1
Userland/Applications/Assistant/main.cpp

@@ -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);
         }
     };