less: trivial code shrink
function old new delta read_lines 715 695 -20 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
d6e7672545
commit
865814a617
@ -428,14 +428,13 @@ static void read_lines(void)
|
|||||||
w -= 8;
|
w -= 8;
|
||||||
|
|
||||||
p = current_line = ((char*)xmalloc(w + 4)) + 4;
|
p = current_line = ((char*)xmalloc(w + 4)) + 4;
|
||||||
max_fline += last_terminated;
|
|
||||||
if (!last_terminated) {
|
if (!last_terminated) {
|
||||||
const char *cp = flines[max_fline];
|
const char *cp = flines[max_fline];
|
||||||
strcpy(p, cp);
|
p = stpcpy(p, cp);
|
||||||
p += strlen(current_line);
|
free(MEMPTR(cp));
|
||||||
free(MEMPTR(flines[max_fline]));
|
|
||||||
/* last_line_pos is still valid from previous read_lines() */
|
/* last_line_pos is still valid from previous read_lines() */
|
||||||
} else {
|
} else {
|
||||||
|
max_fline++;
|
||||||
last_line_pos = 0;
|
last_line_pos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user