Use a comparison to check for wrap and avoid an expensive modulus.

pull/2151/head
nicm 2020-04-01 07:52:07 +00:00
parent 89d2a20e56
commit c129ed3233
1 changed files with 3 additions and 2 deletions

View File

@ -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].dlen);
cell++;
px = (px + 1) % gd->sx;
if (px == 0) {
px++;
if (px == gd->sx) {
px = 0;
pywrap++;
gl = grid_peek_line(gd, pywrap);
}