Remove unnecessary allocations
This commit is contained in:
		
							parent
							
								
									a54acce6b7
								
							
						
					
					
						commit
						7b97075282
					
				
					 1 changed files with 4 additions and 8 deletions
				
			
		| 
						 | 
				
			
			@ -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;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue