From dfc17244d49e04985c9c60bc6435715fcfe2d1dd Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Sat, 1 Jul 2023 05:39:41 +0300 Subject: [PATCH] Perf: don't search for niluuid items when moving cursor in eeschema. Reduces CPU usage by 60% in some cases. (cherry picked from commit 55b31030c0fef9baee893bdbbbbd3ea0f1e4f431) --- eeschema/tools/ee_selection_tool.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eeschema/tools/ee_selection_tool.cpp b/eeschema/tools/ee_selection_tool.cpp index a35bfc6130..ea329fb79d 100644 --- a/eeschema/tools/ee_selection_tool.cpp +++ b/eeschema/tools/ee_selection_tool.cpp @@ -661,9 +661,11 @@ int EE_SELECTION_TOOL::Main( const TOOL_EVENT& aEvent ) } } - if( EDA_ITEM* item = m_frame->GetItem( rolloverItem ) ) + if( rolloverItem != niluuid ) { - if( !( item->GetFlags() & IS_ROLLOVER ) ) + EDA_ITEM* item = m_frame->GetItem( rolloverItem ); + + if( item && !( item->GetFlags() & IS_ROLLOVER ) ) { item->SetFlags( IS_ROLLOVER ); lastRolloverItem = rolloverItem;