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