]> code.delx.au - gnu-emacs/commitdiff
* intervals.c (temp_set_point_both): Move test into 'eassert',
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 9 Oct 2013 17:56:58 +0000 (10:56 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 9 Oct 2013 17:56:58 +0000 (10:56 -0700)
for speed.

src/ChangeLog
src/intervals.c

index 7800959b0915a500458ecff7653fd82c5a2faa6a..e4456b2ce2bb6059a52244af7a7a5bec58e4721d 100644 (file)
@@ -1,5 +1,8 @@
 2013-10-09  Paul Eggert  <eggert@cs.ucla.edu>
 
+       * intervals.c (temp_set_point_both): Move test into 'eassert',
+       for speed.
+
        * lisp.h (eassert): Don't use 'assume'.
        Sometimes 'assume' wins in performance, and sometimes it loses,
        so it shouldn't be used all the time.  Perhaps we need two
index 69a3386728321c8006bac128b19f70beaa73d44e..a9c4f5aed0ba6f38a0605b0bf5b3cffeb16783b0 100644 (file)
@@ -1792,8 +1792,7 @@ temp_set_point_both (struct buffer *buffer,
                     ptrdiff_t charpos, ptrdiff_t bytepos)
 {
   /* In a single-byte buffer, the two positions must be equal.  */
-  if (BUF_ZV (buffer) == BUF_ZV_BYTE (buffer))
-    eassert (charpos == bytepos);
+  eassert (BUF_ZV (buffer) != BUF_ZV_BYTE (buffer) || charpos == bytepos);
 
   eassert (charpos <= bytepos);
   eassert (charpos <= BUF_ZV (buffer) || BUF_BEGV (buffer) <= charpos);