unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: emacs-devel@gnu.org
Cc: Philipp Stephani <phst@google.com>
Subject: [PATCH] * src/editfns.c (Fchar_after): Small optimization.
Date: Sat, 30 Sep 2017 20:41:11 +0200	[thread overview]
Message-ID: <20170930184111.41806-1-phst@google.com> (raw)

---
 src/editfns.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/editfns.c b/src/editfns.c
index b03eb947de..e87c682f97 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -1256,10 +1256,10 @@ If POS is out of range, the value is nil.  */)
   if (NILP (pos))
     {
       pos_byte = PT_BYTE;
-      XSETFASTINT (pos, PT);
+      if (pos_byte == ZV_BYTE)
+        return Qnil;
     }
-
-  if (MARKERP (pos))
+  else if (MARKERP (pos))
     {
       pos_byte = marker_byte_position (pos);
       if (pos_byte < BEGV_BYTE || pos_byte >= ZV_BYTE)
-- 
2.14.1




             reply	other threads:[~2017-09-30 18:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-30 18:41 Philipp Stephani [this message]
2017-09-30 19:05 ` [PATCH] * src/editfns.c (Fchar_after): Small optimization Eli Zaretskii
2017-10-01 10:56   ` Philipp Stephani
2017-10-01 15:04     ` Eli Zaretskii
2017-10-01 16:30       ` Philipp Stephani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170930184111.41806-1-phst@google.com \
    --to=p.stephani2@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=phst@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).