Skip to content

Commit

Permalink
Cleanup|libappfw|GridLayout: Added an assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed May 16, 2015
1 parent f59e172 commit 3c13652
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions doomsday/sdk/libappfw/src/gridlayout.cpp
Expand Up @@ -211,25 +211,22 @@ DENG2_PIMPL(GridLayout)
addMetric(list);
}
DENG2_ASSERT(index < list.size());


if (list[index]) {

Metric &metric = *list[index];

if(!metric.fixedLength)
{
changeRef(metric.current, OperatorRule::maximum(rule, metric.current));

// Update the indirection.
metric.final->setSource(*metric.current);
}
else
{
// Fixed lengths are never affected.
metric.final->setSource(*metric.fixedLength);
}
DENG2_ASSERT(list[index] != nullptr);
if(!list[index]) return;

Metric &metric = *list[index];
if(!metric.fixedLength)
{
changeRef(metric.current, OperatorRule::maximum(rule, metric.current));

// Update the indirection.
metric.final->setSource(*metric.current);
}
else
{
// Fixed lengths are never affected.
metric.final->setSource(*metric.fixedLength);
}
}

Expand Down

0 comments on commit 3c13652

Please sign in to comment.