From 5b76b1585f387a161625d4bed7a55218472ce5b2 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Sun, 4 Jan 2009 15:56:54 +0000 Subject: [PATCH] Remove useless code, cur_line is always the last line of the textbuffer. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4976 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-text/textbuffer.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/fe-text/textbuffer.c b/src/fe-text/textbuffer.c index abef27c4..c36ab250 100644 --- a/src/fe-text/textbuffer.c +++ b/src/fe-text/textbuffer.c @@ -217,14 +217,7 @@ static LINE_REC *textbuffer_line_insert(TEXT_BUFFER_REC *buffer, LINE_REC *textbuffer_line_last(TEXT_BUFFER_REC *buffer) { - LINE_REC *line; - - line = buffer->cur_line; - if (line != NULL) { - while (line->next != NULL) - line = line->next; - } - return line; + return buffer->cur_line; } int textbuffer_line_exists_after(LINE_REC *line, LINE_REC *search) @@ -338,8 +331,7 @@ void textbuffer_remove(TEXT_BUFFER_REC *buffer, LINE_REC *line) line->next->prev = line->prev; if (buffer->cur_line == line) { - buffer->cur_line = line->next != NULL ? - line->next : line->prev; + buffer->cur_line = line->prev; } line->prev = line->next = NULL;