mirror of
https://github.com/irssi/irssi.git
synced 2025-04-26 04:51:11 -05:00
Performance improvements for /lastlog -before
This avoids the use of g_list_find() to find if a match was already added to the list of results, by checking the last two added matches instead. Checking just the last match isn't enough because a NULL match is added as a separator (shown as -- in the UI)
This commit is contained in:
parent
0e44ea8916
commit
e498265328
@ -610,7 +610,8 @@ GList *textbuffer_find_text(TEXT_BUFFER_REC *buffer, LINE_REC *startline,
|
|||||||
pre_line = line;
|
pre_line = line;
|
||||||
for (i = 0; i < before; i++) {
|
for (i = 0; i < before; i++) {
|
||||||
if (pre_line->prev == NULL ||
|
if (pre_line->prev == NULL ||
|
||||||
g_list_find(matches, pre_line->prev) != NULL)
|
g_list_nth_data(matches, 0) == pre_line->prev ||
|
||||||
|
g_list_nth_data(matches, 1) == pre_line->prev)
|
||||||
break;
|
break;
|
||||||
pre_line = pre_line->prev;
|
pre_line = pre_line->prev;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user