From ed912ab3ae61981d0731ebe19b56d393cdddad55 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 28 Jul 2013 08:22:53 +0200 Subject: [PATCH] Avoid redundant per-frame calls to getDbProp("UI:VARIABLES:CDB_INIT_IN_PROGRESS") --HG-- branch : kaetemi-optimize --- code/ryzom/client/src/cdb_synchronised.cpp | 6 +++++- code/ryzom/client/src/cdb_synchronised.h | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/code/ryzom/client/src/cdb_synchronised.cpp b/code/ryzom/client/src/cdb_synchronised.cpp index 08189fdd4..f733f6c67 100644 --- a/code/ryzom/client/src/cdb_synchronised.cpp +++ b/code/ryzom/client/src/cdb_synchronised.cpp @@ -318,7 +318,11 @@ void CCDBSynchronised::writeInitInProgressIntoUIDB() { CInterfaceManager *pIM = CInterfaceManager::getInstance(); if (pIM) - NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:CDB_INIT_IN_PROGRESS")->setValueBool(_InitInProgress); + { + NLMISC::CCDBNodeLeaf *node = m_CDBInitInProgressDB ? (&*m_CDBInitInProgressDB) + : (m_CDBInitInProgressDB = NLGUI::CDBManager::getInstance()->getDbProp("UI:VARIABLES:CDB_INIT_IN_PROGRESS")); + node->setValueBool(_InitInProgress); + } else nlwarning("InterfaceManager not created"); } diff --git a/code/ryzom/client/src/cdb_synchronised.h b/code/ryzom/client/src/cdb_synchronised.h index 7f8f1fb5e..e5c2f4876 100644 --- a/code/ryzom/client/src/cdb_synchronised.h +++ b/code/ryzom/client/src/cdb_synchronised.h @@ -151,6 +151,8 @@ private: bool allInitPacketReceived() const { return _InitDeltaReceived == 2; } // Classic database + inventory void writeInitInProgressIntoUIDB(); + + NLMISC::CRefPtr m_CDBInitInProgressDB; };