[hackers] [st] Remove 'slide' variable in tresize. || noname_AT_inventati.org

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

commit c569e3146e6999f6a02acecd145929c87e15b528
Author: noname_AT_inventati.org <noname_AT_inventati.org>
Date: Sat Apr 11 19:30:36 2015 +0200

    Remove 'slide' variable in tresize.

diff --git a/st.c b/st.c
index 79bf1c8..2c58a3e 100644
--- a/st.c
+++ b/st.c
_AT_@ -2769,7 +2769,6 @@ tresize(int col, int row) {
         int i;
         int minrow = MIN(row, term.row);
         int mincol = MIN(col, term.col);
- int slide = term.c.y - row + 1;
         bool *bp;
         TCursor c;
 
_AT_@ -2784,13 +2783,13 @@ tresize(int col, int row) {
          * tscrollup would work here, but we can optimize to
          * memmove because we're freeing the earlier lines
          */
- for(i = 0; i < slide; i++) {
+ for(i = 0; i <= term.c.y - row; i++) {
                 free(term.line[i]);
                 free(term.alt[i]);
         }
- if(slide > 0) {
- memmove(term.line, term.line + slide, row * sizeof(Line));
- memmove(term.alt, term.alt + slide, row * sizeof(Line));
+ if(i > 0) {
+ memmove(term.line, term.line + i, row * sizeof(Line));
+ memmove(term.alt, term.alt + i, row * sizeof(Line));
         }
         for(i += row; i < term.row; i++) {
                 free(term.line[i]);
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:24 CEST