[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Redundant if clause in xdisp.c?
From: |
Eli Zaretskii |
Subject: |
Redundant if clause in xdisp.c? |
Date: |
Sat, 29 Aug 2009 15:46:32 +0300 |
Unless I'm missing something, both branches of the if clause below
(from xdisp.c:redisplay_internal) are identical, except for the
comments:
if (Z - CHARPOS (tlendpos) == ZV)
{
/* This line ends at end of (accessible part of)
buffer. There is no newline to count. */
delta = (Z
- CHARPOS (tlendpos)
- MATRIX_ROW_START_CHARPOS (row));
delta_bytes = (Z_BYTE
- BYTEPOS (tlendpos)
- MATRIX_ROW_START_BYTEPOS (row));
}
else
{
/* This line ends in a newline. Must take
account of the newline and the rest of the
text that follows. */
delta = (Z
- CHARPOS (tlendpos)
- MATRIX_ROW_START_CHARPOS (row));
delta_bytes = (Z_BYTE
- BYTEPOS (tlendpos)
- MATRIX_ROW_START_BYTEPOS (row));
}
increment_matrix_positions (w->current_matrix,
this_line_vpos + 1,
w->current_matrix->nrows,
delta, delta_bytes);
Okay to remove the condition and to collapse both branches into a
single code fragment?
- Redundant if clause in xdisp.c?,
Eli Zaretskii <=