Ref T184 Optimization: getSelectedDockInfoArea iterates over all info areas in linear O(n) time.

There is no need to do this in isSelectedDockWidgetInfoArea, as it can be checked in constant O(1) time.
This method was occupying a significant proportion of the CPU time of swift.
This commit is contained in:
Mathew Sutcliffe
2017-11-09 02:35:18 +00:00
parent 3e47bdcebc
commit 7328d48e59

View File

@@ -169,7 +169,9 @@ namespace BlackGui
{
if (!infoArea) { return false; }
if (infoArea->isFloating()) { return false; }
return infoArea == this->getSelectedDockInfoArea();
if (!infoArea->isWidgetVisible()) { return false; }
if (!m_tabBar || m_tabBar->count() < 1) { return false; }
return true;
}
const CDockWidgetInfoArea *CInfoArea::getSelectedDockInfoArea() const