No need in function object; just use range-based loop

Change-Id: I08289c35eb1e8babc53406deb25df39f68a0dd88
Reviewed-on: https://gerrit.libreoffice.org/69726
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski
2019-03-26 06:43:08 +01:00
parent 276c722b0c
commit 16103cdd8c

View File

@@ -621,24 +621,10 @@ void ScDPDimensionSaveData::WriteToData( ScDPGroupTableData& rData ) const
rEntry.second.AddToData( rData );
}
namespace {
class AddGroupDimToCache
{
ScDPCache& mrCache;
public:
explicit AddGroupDimToCache(ScDPCache& rCache) : mrCache(rCache) {}
void operator() (const ScDPSaveGroupDimension& rDim)
{
rDim.AddToCache(mrCache);
}
};
}
void ScDPDimensionSaveData::WriteToCache(ScDPCache& rCache) const
{
std::for_each(maGroupDims.begin(), maGroupDims.end(), AddGroupDimToCache(rCache));
for (const auto& rEntry : maGroupDims)
rEntry.AddToCache(rCache);
for (const auto& rEntry : maNumGroupDims)
rEntry.second.AddToCache(rCache);
}