mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Don't create then set, do both at the same time.
When we create, then set the value of a variable, we are wasting cycles and making the code more verbose. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									ec2ea7ec3a
								
							
						
					
					
						commit
						5b497b5655
					
				
					 1 changed files with 1 additions and 2 deletions
				
			
		|  | @ -145,8 +145,7 @@ void TagWidget::completionSelected(const QString& completion) | ||||||
| 
 | 
 | ||||||
| void TagWidget::completionHighlighted(const QString& completion) | void TagWidget::completionHighlighted(const QString& completion) | ||||||
| { | { | ||||||
| 	QPair<int, int> pos; | 	QPair<int, int> pos = getCursorTagPosition(); | ||||||
| 	pos = getCursorTagPosition(); |  | ||||||
| 	if (pos.first >= 0 && pos.second > 0) { | 	if (pos.first >= 0 && pos.second > 0) { | ||||||
| 		setText(text().remove(pos.first, pos.second - pos.first).insert(pos.first, completion)); | 		setText(text().remove(pos.first, pos.second - pos.first).insert(pos.first, completion)); | ||||||
| 		setCursorPosition(pos.first + completion.length()); | 		setCursorPosition(pos.first + completion.length()); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue