mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	A few trivial optimisations: no need to check for zero size if calling
buffer_ensure in buffer.c; expand grid lines by a greater increase than one each time; and don't read UTF-8 data unless it actually needs to be checked when overwriting a cell.
This commit is contained in:
		
							
								
								
									
										4
									
								
								grid.c
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								grid.c
									
									
									
									
									
								
							@@ -198,6 +198,10 @@ grid_expand_line(struct grid *gd, u_int py, u_int sx)
 | 
			
		||||
	if (sx <= gl->cellsize)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	if (gl->cellsize > gd->sx / 2)
 | 
			
		||||
		sx = gd->sx;
 | 
			
		||||
	else
 | 
			
		||||
		sx = 1 + gl->cellsize * 2;
 | 
			
		||||
	gl->celldata = xrealloc(gl->celldata, sx, sizeof *gl->celldata);
 | 
			
		||||
	for (xx = gl->cellsize; xx < sx; xx++)
 | 
			
		||||
		grid_put_cell(gd, xx, py, &grid_default_cell);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user