fixed potential infinite loop

This commit is contained in:
Peter Schojer 2008-07-23 10:01:51 +00:00
parent 8f8072880e
commit 461de57265

View File

@ -96,12 +96,15 @@ void GridLayout::minimize()
if (vec.empty())
return;
const std::size_t pos = vec.size() - 1;
std::size_t i = pos;
for (; i >= 0; --i)
std::size_t i = vec.size();
do
{
--i;
if (vec[i])
break;
}
while (i > 0);
if (i < pos)
{
// pos to cnt