mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Use a comparison to check for wrap and avoid an expensive modulus.
This commit is contained in:
		@@ -2523,8 +2523,9 @@ window_copy_cstrtocellpos(struct grid *gd, u_int ncells, u_int *ppx, u_int *ppy,
 | 
				
			|||||||
		cells[cell].d = window_copy_cellstring(gl, px,
 | 
							cells[cell].d = window_copy_cellstring(gl, px,
 | 
				
			||||||
		    &cells[cell].dlen);
 | 
							    &cells[cell].dlen);
 | 
				
			||||||
		cell++;
 | 
							cell++;
 | 
				
			||||||
		px = (px + 1) % gd->sx;
 | 
							px++;
 | 
				
			||||||
		if (px == 0) {
 | 
							if (px == gd->sx) {
 | 
				
			||||||
 | 
								px = 0;
 | 
				
			||||||
			pywrap++;
 | 
								pywrap++;
 | 
				
			||||||
			gl = grid_peek_line(gd, pywrap);
 | 
								gl = grid_peek_line(gd, pywrap);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user