Avoid unnecessary allocation if targetGrid is reusable (#16343)

This commit is contained in:
mogemimi 2016-08-15 15:07:37 +09:00 committed by minggo
parent 7f222c92e0
commit b837dd7a20
1 changed files with 1 additions and 2 deletions

View File

@ -50,8 +50,6 @@ void GridAction::startWithTarget(Node *target)
ActionInterval::startWithTarget(target);
cacheTargetAsGridNode();
GridBase *newgrid = this->getGrid();
GridBase *targetGrid = _gridNodeTarget->getGrid();
if (targetGrid && targetGrid->getReuseGrid() > 0)
@ -73,6 +71,7 @@ void GridAction::startWithTarget(Node *target)
targetGrid->setActive(false);
}
auto newgrid = this->getGrid();
_gridNodeTarget->setGrid(newgrid);
_gridNodeTarget->getGrid()->setActive(true);
}