diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-08-21 21:09:13 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-08-21 21:09:13 +0000 |
commit | 4b883524d8da98b2f00e83437cc06bd65228fc5b (patch) | |
tree | 3ef96ab68b0aeae68b7cc7ad0a3d0d178ff6758f /grid.c | |
parent | 15556ad0d67f3c1345fc4d462ab2949816ca7849 (diff) | |
download | rtmux-4b883524d8da98b2f00e83437cc06bd65228fc5b.tar.gz rtmux-4b883524d8da98b2f00e83437cc06bd65228fc5b.tar.bz2 rtmux-4b883524d8da98b2f00e83437cc06bd65228fc5b.zip |
Sync OpenBSD patchset 282:
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.
Diffstat (limited to 'grid.c')
-rw-r--r-- | grid.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: grid.c,v 1.30 2009-08-10 21:40:21 tcunha Exp $ */ +/* $Id: grid.c,v 1.31 2009-08-21 21:09:13 tcunha Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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); |