[hackers] [st] Simplify tmoveto. || noname_AT_inventati.org

From: <git_AT_suckless.org>
Date: Tue, 14 Apr 2015 09:56:42 +0200 (CEST)

commit b0310fba5de0c519eae0c8a2817ccc7bfcdd5222
Author: noname_AT_inventati.org <noname_AT_inventati.org>
Date: Mon Apr 13 14:03:51 2015 +0200

    Simplify tmoveto.
    
    LIMIT returns value. This fact is already used in x2col and y2row.

diff --git a/st.c b/st.c
index 0558593..79bb6aa 100644
--- a/st.c
+++ b/st.c
_AT_@ -1571,11 +1571,9 @@ tmoveto(int x, int y) {
                 miny = 0;
                 maxy = term.row - 1;
         }
- LIMIT(x, 0, term.col-1);
- LIMIT(y, miny, maxy);
         term.c.state &= ~CURSOR_WRAPNEXT;
- term.c.x = x;
- term.c.y = y;
+ term.c.x = LIMIT(x, 0, term.col-1);
+ term.c.y = LIMIT(y, miny, maxy);
 }
 
 void
Received on Tue Apr 14 2015 - 09:56:42 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 14 2015 - 10:00:28 CEST