summaryrefslogtreecommitdiff
path: root/src/fe-common
diff options
context:
space:
mode:
authorailin-nemui <ailin-nemui@users.noreply.github.com>2016-12-20 21:40:18 +0100
committerailin-nemui <ailin-nemui@users.noreply.github.com>2016-12-20 21:40:18 +0100
commit9151f87145e6c9ea40192e0e7c8266eacaaa335f (patch)
tree1d1019b6b1a7675c9321aa5d8e00ca3b2a186298 /src/fe-common
parent9a018a782c40ed9da88ae88a7f1c01265f3342de (diff)
downloadirssi-9151f87145e6c9ea40192e0e7c8266eacaaa335f.zip
remove some for loops
Diffstat (limited to 'src/fe-common')
-rw-r--r--src/fe-common/core/fe-windows.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/fe-common/core/fe-windows.c b/src/fe-common/core/fe-windows.c
index 248cd621..0afa2914 100644
--- a/src/fe-common/core/fe-windows.c
+++ b/src/fe-common/core/fe-windows.c
@@ -165,7 +165,7 @@ static void windows_pack(int removed_refnum)
iter = windows_seq_refnum_lookup(refnum);
if (iter == NULL) return;
- for (; iter != end; refnum++, iter = g_sequence_iter_next(iter)) {
+ while (iter != end) {
window = g_sequence_get(iter);
if (window == NULL || window->sticky_refnum || window->refnum != refnum)
@@ -173,6 +173,9 @@ static void windows_pack(int removed_refnum)
window_set_refnum0(window, refnum - 1);
windows_seq_changed(iter);
+
+ refnum++;
+ iter = g_sequence_iter_next(iter);
}
}
@@ -556,12 +559,10 @@ GSList *windows_get_sorted(void)
GSList *sorted;
sorted = NULL;
- for (iter = windows_seq_end(),
- begin = windows_seq_begin();
-
- iter != begin;
+ iter = windows_seq_end();
+ begin = windows_seq_begin();
- ) {
+ while (iter != begin) {
iter = g_sequence_iter_prev(iter);
WINDOW_REC *rec = g_sequence_get(iter);