all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Redundant if clause in xdisp.c?
@ 2009-08-29 12:46 Eli Zaretskii
  2009-08-29 14:16 ` Chong Yidong
  2009-08-29 15:50 ` Stefan Monnier
  0 siblings, 2 replies; 6+ messages in thread
From: Eli Zaretskii @ 2009-08-29 12:46 UTC (permalink / raw)
  To: emacs-devel

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?




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-08-30 18:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-29 12:46 Redundant if clause in xdisp.c? Eli Zaretskii
2009-08-29 14:16 ` Chong Yidong
2009-08-29 15:50 ` Stefan Monnier
2009-08-29 17:40   ` Eli Zaretskii
2009-08-29 21:21     ` Stefan Monnier
2009-08-30 18:06       ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.