[new downloader] Review fixes.

This commit is contained in:
Vladimir Byko-Ianko 2016-02-29 15:49:17 +03:00 committed by Sergey Yershov
parent a3045f05f8
commit e3f5bcda17

View file

@ -1309,16 +1309,16 @@ void Storage::GetNodeAttrs(TCountryId const & countryId, NodeAttrs & nodeAttrs)
CalculateProgress(downloadingMwm, descendants, downloadingMwmProgress, setQueue);
// Local mwm information.
nodeAttrs.m_localMwmCounter = 0;
nodeAttrs.m_localMwmSize = 0;
node->ForEachInSubtree([this, &nodeAttrs](TCountriesContainer const & d)
{
auto const localeMapIt = m_localFiles.find(d.Value().Name());
if (localeMapIt != m_localFiles.end())
{
nodeAttrs.m_localMwmCounter += 1;
list<TLocalFilePtr> const & localMwmFiles = localeMapIt->second;
ASSERT_EQUAL(localMwmFiles.size(), 1, ("Storage::GetNodeAttrs is called for two component mwms."));
nodeAttrs.m_localMwmSize += (*localMwmFiles.begin())->GetSize(MapOptions::Map);
}
Storage::TLocalFilePtr const localFile = GetLatestLocalFile(d.Value().Name());
if (localFile == nullptr)
return;
nodeAttrs.m_localMwmCounter += 1;
nodeAttrs.m_localMwmSize += localFile->GetSize(MapOptions::Map);
});
// Parents information.