GOB: Remove needless NULL validation

Reported by GCC 12:

goblin.cpp: In destructor 'virtual Gob::Goblin::~Goblin()':
goblin.cpp:110:77: warning: comparing the result of pointer addition '(((Gob::Goblin*)this)->Gob::Goblin::_goblins[i]->Gob::Goblin::Gob_Object::realStateMach + ((sizetype)(((long long unsigned int)state) * 48)))' and NULL [-Waddress]
  110 |                                         if (_goblins[i]->realStateMach[state])
      |                                                                             ^
This commit is contained in:
Orgad Shaneh 2022-05-26 11:37:42 +03:00 committed by Eugene Sandulenko
parent 7fd1cf5315
commit 5bbb675ad0

View File

@ -107,10 +107,8 @@ Goblin::~Goblin() {
if (_goblins[i]) {
if (_goblins[i]->realStateMach) {
for (state = 0; state < (i == 3 ? 70 : 40); state++)
if (_goblins[i]->realStateMach[state])
for (col = 0; col < 6; col++)
if (_goblins[i]->realStateMach[state][col])
delete _goblins[i]->realStateMach[state][col];
for (col = 0; col < 6; col++)
delete _goblins[i]->realStateMach[state][col];
delete[] _goblins[i]->realStateMach;
}
delete _goblins[i];