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()) if (vec.empty())
return; return;
const std::size_t pos = vec.size() - 1; const std::size_t pos = vec.size() - 1;
std::size_t i = pos; std::size_t i = vec.size();
for (; i >= 0; --i)
do
{ {
--i;
if (vec[i]) if (vec[i])
break; break;
} }
while (i > 0);
if (i < pos) if (i < pos)
{ {
// pos to cnt // pos to cnt