[hackers] [dwm] doing it in a shorter way

From: Anselm R. Garbe <garbeam_AT_gmail.com>
Date: Sat Nov 03 21:18:05 2007

changeset: 1055:f2838f633a85
tag: tip
user: Anselm R. Garbe <garbeam_AT_gmail.com>
date: Sat Nov 03 21:14:04 2007 +0100
summary: doing it in a shorter way

diff -r 28813060c35f -r f2838f633a85 dwm.c
--- a/dwm.c Sat Nov 03 20:43:12 2007 +0100
+++ b/dwm.c Sat Nov 03 21:14:04 2007 +0100
@@ -1321,10 +1321,8 @@ run(void) {
                                         *p = '\0';
                                         offset = 0;
                                 }
- else if(offset + r < len - 1)
- offset += r;
                                 else
- offset = 0;
+ offset = (offset + r < len - 1) ? offset + r : 0;
                         }
                         drawbar();
                 }
Received on Sat Nov 03 2007 - 21:18:05 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:58:41 UTC