diff options
author | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2014-03-05 03:08:30 +0100 |
---|---|---|
committer | Jérémie Courrèges-Anglas <jca@wxcvbn.org> | 2014-03-24 10:23:53 +0100 |
commit | 905bce42660f9d0d2da7b3b7460ac672f9d798fd (patch) | |
tree | fab882eb656028503fd6b1faf8981e7020c4b82a | |
parent | 33ed8c59d437ffc3ad993b6cad5fe4c7f23bc99c (diff) | |
download | ratpoison-905bce42660f9d0d2da7b3b7460ac672f9d798fd.zip |
Make unmanaged_window cheaper.
* No need to get then free the window name in the loop,
do it out of the loop.
-rw-r--r-- | src/manage.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/manage.c b/src/manage.c index f54c63a..c6e12b2 100644 --- a/src/manage.c +++ b/src/manage.c @@ -520,19 +520,23 @@ unmanaged_window (Window w) char *wname; int i; - if (!unmanaged_window_list) return 0; + if (!unmanaged_window_list) + return 0; + + wname = get_wmname(w); + if (!wname) + return 0; for (i = 0; i < num_unmanaged_windows; i++) { - wname = get_wmname(w); - if (!wname) return 0; if (!strcmp(unmanaged_window_list[i], wname)) { free(wname); return 1; } - free(wname); } + + free(wname); return 0; } |