summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2014-08-26 20:25:57 -0400
committerQuentin Carbonneaux2014-08-26 20:51:32 -0400
commit0ed310e2e83cf9dc6779304c33a7eac7b467c938 (patch)
tree2351872940dcb2313cc4939494c3afbe84ab50da
parentc47ba5be4ee69616b19adf0a2766f6a7466ee340 (diff)
hoist assignments out of a loop
-rw-r--r--win.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/win.c b/win.c
index af79446..d56c4ed 100644
--- a/win.c
+++ b/win.c
@@ -235,12 +235,13 @@ win_redraw_frame()
W *w;
int i;
+ b = (GRect){ 0, 0, g->border, fheight };
for (i=0; (w = screen[i]); i++) {
assert(!screen[i+1] || w->gr.x + w->gr.w + g->border == screen[i+1]->gr.x);
if (dirty(w)) {
if (screen[i+1]) {
- b = (GRect){ w->gr.x + w->gr.w, 0, g->border, fheight };
- g->drawrect(&b, 0, 0, g->border, b.h, GGray);
+ b.x = w->gr.x + w->gr.w;
+ g->drawrect(&b, 0, 0, b.w, b.h, GGray);
}
draw(w, GPaleYellow);
if (tag.owner == w)