Remove unnecessary allocations

This commit is contained in:
Jonas Kulla 2013-10-01 18:27:22 +02:00
parent a54acce6b7
commit 7b97075282
1 changed files with 4 additions and 8 deletions

View File

@ -287,6 +287,8 @@ struct InputPrivate
/* Collective binding array */
QVector<Binding*> bindings;
ButtonState stateArray[Input::buttonCodeSize*2];
ButtonState *states;
ButtonState *statesOld;
@ -311,8 +313,8 @@ struct InputPrivate
initJsBindings();
initMsBindings();
states = new ButtonState[Input::buttonCodeSize];
statesOld = new ButtonState[Input::buttonCodeSize];
states = stateArray;
statesOld = stateArray + Input::buttonCodeSize;
/* Clear buffers */
clearBuffer();
@ -328,12 +330,6 @@ struct InputPrivate
dir8Data.active = 0;
}
~InputPrivate()
{
delete[] states;
delete[] statesOld;
}
inline ButtonState &getStateCheck(int code)
{
int index;