forked from PsychoticNinja/irssi
nits
This commit is contained in:
parent
9004265e54
commit
03f5dc63fe
@ -59,19 +59,17 @@ static int window_get_new_refnum(void)
|
|||||||
int refnum;
|
int refnum;
|
||||||
|
|
||||||
refnum = 1;
|
refnum = 1;
|
||||||
for (iter = windows_seq_begin(),
|
iter = windows_seq_begin();
|
||||||
end = windows_seq_end();
|
end = windows_seq_end();
|
||||||
|
|
||||||
iter != end;
|
while (iter != end) {
|
||||||
|
|
||||||
refnum++,
|
|
||||||
iter = g_sequence_iter_next(iter)) {
|
|
||||||
|
|
||||||
win = g_sequence_get(iter);
|
win = g_sequence_get(iter);
|
||||||
|
|
||||||
if (refnum != win->refnum) {
|
if (refnum != win->refnum)
|
||||||
return refnum;
|
return refnum;
|
||||||
}
|
|
||||||
|
refnum++;
|
||||||
|
iter = g_sequence_iter_next(iter);
|
||||||
}
|
}
|
||||||
|
|
||||||
return refnum;
|
return refnum;
|
||||||
@ -468,11 +466,16 @@ WINDOW_REC *window_find_item(SERVER_REC *server, const char *name)
|
|||||||
return window_item_window(item);
|
return window_item_window(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* search to the numerically right iterator of refnum */
|
||||||
static GSequenceIter *windows_seq_refnum_search_right(int refnum)
|
static GSequenceIter *windows_seq_refnum_search_right(int refnum)
|
||||||
{
|
{
|
||||||
return g_sequence_search(windows_seq, GINT_TO_POINTER(refnum), (GCompareDataFunc)window_refnum_lookup, NULL);
|
return g_sequence_search(windows_seq, GINT_TO_POINTER(refnum), (GCompareDataFunc)window_refnum_lookup, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* we want to find the numerically left iterator of refnum, so we
|
||||||
|
search the right of the previous refnum. but we need to figure out
|
||||||
|
the case where the iterator is already at the beginning, i.e
|
||||||
|
iter->refnum >= refnum */
|
||||||
static GSequenceIter *windows_seq_refnum_search_left(int refnum)
|
static GSequenceIter *windows_seq_refnum_search_left(int refnum)
|
||||||
{
|
{
|
||||||
GSequenceIter *iter = windows_seq_refnum_search_right(refnum - 1);
|
GSequenceIter *iter = windows_seq_refnum_search_right(refnum - 1);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user