diff options
author | Timo Sirainen <cras@irssi.org> | 2001-07-12 21:44:01 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2001-07-12 21:44:01 +0000 |
commit | 9eed52fa40664819c39fa264cc4b15ea06f9b4e5 (patch) | |
tree | c8c66e44d0144829fa941ab82d7a983b7fe400d1 /src/fe-text/textbuffer-commands.c | |
parent | dd37b9ca2c5ea17349a76d96c05eecaa10287d95 (diff) | |
download | irssi-9eed52fa40664819c39fa264cc4b15ea06f9b4e5.zip |
Replaced GList by adding prev/next pointers to LINE_REC. This should make
some things faster and take a bit less memory. Also fixed an evil memory
leak.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1611 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text/textbuffer-commands.c')
-rw-r--r-- | src/fe-text/textbuffer-commands.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/fe-text/textbuffer-commands.c b/src/fe-text/textbuffer-commands.c index 92ec70bd..24847dac 100644 --- a/src/fe-text/textbuffer-commands.c +++ b/src/fe-text/textbuffer-commands.c @@ -74,13 +74,13 @@ static void scrollback_goto_line(int linenum) if (view->buffer->lines_count == 0) return; - textbuffer_view_scroll_line(view, view->buffer->lines->data); + textbuffer_view_scroll_line(view, view->buffer->first_line); gui_window_scroll(active_win, linenum); } static void scrollback_goto_time(const char *datearg, const char *timearg) { - GList *tmp; + LINE_REC *line; struct tm tm; time_t now, stamp; int day, month; @@ -145,12 +145,10 @@ static void scrollback_goto_time(const char *datearg, const char *timearg) } /* scroll to first line after timestamp */ - tmp = textbuffer_view_get_lines(WINDOW_GUI(active_win)->view); - for (; tmp != NULL; tmp = tmp->next) { - LINE_REC *rec = tmp->data; - - if (rec->info.time >= stamp) { - gui_window_scroll_line(active_win, rec); + line = textbuffer_view_get_lines(WINDOW_GUI(active_win)->view); + for (; line != NULL; line = line->next) { + if (line->info.time >= stamp) { + gui_window_scroll_line(active_win, line); break; } } @@ -188,7 +186,7 @@ static void cmd_scrollback_home(const char *data) buffer = WINDOW_GUI(active_win)->view->buffer; if (buffer->lines_count > 0) - gui_window_scroll_line(active_win, buffer->lines->data); + gui_window_scroll_line(active_win, buffer->first_line); } /* SYNTAX: SCROLLBACK END */ @@ -200,7 +198,7 @@ static void cmd_scrollback_end(const char *data) if (view->bottom_startline == NULL) return; - textbuffer_view_scroll_line(view, view->bottom_startline->data); + textbuffer_view_scroll_line(view, view->bottom_startline); gui_window_scroll(active_win, view->bottom_subline); } |