Clean up the code a bit

refs #9096
This commit is contained in:
Gunnar Beutner 2015-08-25 17:19:59 +02:00
parent 8fc92d8a08
commit 827125a69a
1 changed files with 5 additions and 2 deletions

View File

@ -328,8 +328,7 @@ bool ConfigItem::CommitNewItems(WorkQueue& upq, std::vector<ConfigItem::Ptr>& ne
boost::mutex::scoped_lock lock(m_Mutex); boost::mutex::scoped_lock lock(m_Mutex);
BOOST_FOREACH(const TypeMap::value_type& kv, m_Items) { BOOST_FOREACH(const TypeMap::value_type& kv, m_Items) {
BOOST_FOREACH(const ItemMap::value_type& kv2, kv.second) BOOST_FOREACH(const ItemMap::value_type& kv2, kv.second) {
{
if (!kv2.second->m_Abstract && !kv2.second->m_Object) if (!kv2.second->m_Abstract && !kv2.second->m_Object)
items.push_back(std::make_pair(kv2.second, false)); items.push_back(std::make_pair(kv2.second, false));
} }
@ -403,6 +402,8 @@ bool ConfigItem::CommitNewItems(WorkQueue& upq, std::vector<ConfigItem::Ptr>& ne
continue; continue;
BOOST_FOREACH(const ConfigItem::Ptr& item, new_items) { BOOST_FOREACH(const ConfigItem::Ptr& item, new_items) {
ASSERT(item->m_Object);
if (item->m_Type == type) if (item->m_Type == type)
upq.Enqueue(boost::bind(&ConfigObject::OnAllConfigLoaded, item->m_Object)); upq.Enqueue(boost::bind(&ConfigObject::OnAllConfigLoaded, item->m_Object));
} }
@ -416,6 +417,8 @@ bool ConfigItem::CommitNewItems(WorkQueue& upq, std::vector<ConfigItem::Ptr>& ne
BOOST_FOREACH(const String& loadDep, ptype->GetLoadDependencies()) { BOOST_FOREACH(const String& loadDep, ptype->GetLoadDependencies()) {
BOOST_FOREACH(const ConfigItem::Ptr& item, new_items) { BOOST_FOREACH(const ConfigItem::Ptr& item, new_items) {
ASSERT(item->m_Object);
if (item->m_Type == loadDep) if (item->m_Type == loadDep)
upq.Enqueue(boost::bind(&ConfigObject::CreateChildObjects, item->m_Object, ptype)); upq.Enqueue(boost::bind(&ConfigObject::CreateChildObjects, item->m_Object, ptype));
} }