mirror of
https://github.com/tmux/tmux.git
synced 2024-12-13 18:38:48 +00:00
Use a comparison to check for wrap and avoid an expensive modulus.
This commit is contained in:
parent
0dbf414578
commit
3476eccf48
@ -2494,8 +2494,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].dlen);
|
||||
cell++;
|
||||
px = (px + 1) % gd->sx;
|
||||
if (px == 0) {
|
||||
px++;
|
||||
if (px == gd->sx) {
|
||||
px = 0;
|
||||
pywrap++;
|
||||
gl = grid_peek_line(gd, pywrap);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user