diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2009-01-04 15:56:54 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2009-01-04 15:56:54 +0000 |
commit | 5b76b1585f387a161625d4bed7a55218472ce5b2 (patch) | |
tree | e9f0c93b2a9c90e77666f3cbd7dae34ba0b29b34 /src | |
parent | 8cc7a02b4d5ffcde7cd5dd50df65f6f6e68eab76 (diff) | |
download | irssi-5b76b1585f387a161625d4bed7a55218472ce5b2.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-text/textbuffer.c | 12 |
1 files 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; |