Try to get around G++'s dislike of my iterators by using an integer index instead.

Originally committed to SVN as r3419.
This commit is contained in:
Niels Martin Hansen 2009-08-16 04:31:29 +00:00
parent b37310e286
commit 4526b0dc43

View file

@ -218,8 +218,9 @@ public:
// Get a list of macro blocks sorted by access count
std::vector<AccessData> access_data;
access_data.reserve(data.size());
for (typename MacroBlockArray::iterator mb = data.begin(); mb != data.end(); ++mb)
access_data.push_back(AccessData(&*mb));
// For whatever reason, G++ pukes if I try using iterators here...
for (size_t mbi = 0; mbi != data.size(); ++mbi)
access_data.push_back(AccessData(&data[mbi]));
std::sort(access_data.begin(), access_data.end());
// Sum up data size until we hit the max