Remove unnecessary if-condition from Selection_deselect()

This commit is contained in:
David Capello 2018-08-30 20:17:26 -03:00
parent 7b4609d2d1
commit 5dd09187b3

View File

@ -60,19 +60,17 @@ int Selection_gc(lua_State* L)
int Selection_deselect(lua_State* L)
{
auto obj = get_obj<SelectionObject>(L, 1);
if (obj) {
if (obj->sprite) {
Doc* doc = static_cast<Doc*>(obj->sprite->document());
ASSERT(doc);
if (obj->sprite) {
Doc* doc = static_cast<Doc*>(obj->sprite->document());
ASSERT(doc);
Tx tx;
tx(new cmd::DeselectMask(doc));
tx.commit();
}
else {
ASSERT(obj->mask);
obj->mask->clear();
}
Tx tx;
tx(new cmd::DeselectMask(doc));
tx.commit();
}
else {
ASSERT(obj->mask);
obj->mask->clear();
}
return 0;
}