mirror of
https://github.com/MidnightCommander/mc
synced 2025-03-09 01:21:25 +03:00
Ticket #2545: optimization of history saving.
(hist_next): get rid of direct access to the next histroy item. (history_show): remove redundant check. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
f3ae923a6d
commit
166281c39a
@ -394,8 +394,7 @@ history_show (GList ** history, Widget * widget)
|
||||
char *q;
|
||||
|
||||
listbox_get_current (query_list, &q, NULL);
|
||||
if (q != NULL)
|
||||
r = g_strdup (q);
|
||||
r = g_strdup (q);
|
||||
}
|
||||
|
||||
/* get modified history from dialog */
|
||||
|
@ -593,6 +593,8 @@ hist_prev (WInput * in)
|
||||
static void
|
||||
hist_next (WInput * in)
|
||||
{
|
||||
GList *next;
|
||||
|
||||
if (in->need_push)
|
||||
{
|
||||
push_history (in, in->buffer);
|
||||
@ -603,12 +605,13 @@ hist_next (WInput * in)
|
||||
if (in->history == NULL)
|
||||
return;
|
||||
|
||||
if (in->history->next == NULL)
|
||||
next = g_list_next (in->history);
|
||||
if (next == NULL)
|
||||
input_assign_text (in, "");
|
||||
else
|
||||
{
|
||||
in->history = g_list_next (in->history);
|
||||
input_assign_text (in, (char *) in->history->data);
|
||||
in->history = next;
|
||||
input_assign_text (in, (char *) next->data);
|
||||
in->need_push = FALSE;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user