Removed unnecessary select of groups in RsGxsNetService::locked_genReqGrpTransaction.

This commit is contained in:
thunder2 2015-08-27 00:54:37 +02:00
parent 753846beaf
commit 4d7f92ecbe

View File

@ -2159,6 +2159,9 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr)
std::cerr << "locked_genReqGrpTransaction(): " << std::endl;
#endif
std::map<RsGxsGroupId, RsGxsGrpMetaData*> grpMetaMap;
std::map<RsGxsGroupId, RsGxsGrpMetaData*>::const_iterator metaIter;
std::list<RsNxsSyncGrpItem*> grpItemL;
std::list<RsNxsItem*>::iterator lit = tr->mItems.begin();
@ -2168,6 +2171,7 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr)
if(item)
{
grpItemL.push_back(item);
grpMetaMap[item->grpId] = NULL;
}else
{
#ifdef NXS_NET_DEBUG
@ -2177,8 +2181,11 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr)
}
}
std::map<RsGxsGroupId, RsGxsGrpMetaData*> grpMetaMap;
std::map<RsGxsGroupId, RsGxsGrpMetaData*>::const_iterator metaIter;
if (grpItemL.empty())
{
return;
}
mDataStore->retrieveGxsGrpMetaData(grpMetaMap);
// now do compare and add loop
@ -2198,7 +2205,7 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr)
metaIter = grpMetaMap.find(grpId);
bool haveItem = false;
bool latestVersion = false;
if (metaIter != grpMetaMap.end())
if (metaIter != grpMetaMap.end() && metaIter->second)
{
haveItem = true;
latestVersion = grpSyncItem->publishTs > metaIter->second->mPublishTs;