]> git.eshelyaron.com Git - emacs.git/commitdiff
Slightly optimize x_check_errors as well
authorPo Lu <luangruo@yahoo.com>
Tue, 31 May 2022 12:56:43 +0000 (20:56 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 31 May 2022 12:56:55 +0000 (20:56 +0800)
* src/xterm.c (x_check_errors): Don't sync if no requests were
made since the error trap was installed.

src/xterm.c

index fb7d18a53fbfe8076ed3a17127e4e21dd7a4b30d..7235a1e9599555b6b0eb51957ae761421d66ead0 100644 (file)
@@ -21414,8 +21414,10 @@ x_check_errors (Display *dpy, const char *format)
 
   /* There is no point in making this extra sync if all requests
      are known to have been fully processed.  */
-  if (LastKnownRequestProcessed (dpy)
-      != NextRequest (dpy) - 1)
+  if ((LastKnownRequestProcessed (dpy)
+       != NextRequest (dpy) - 1)
+      && (NextRequest (dpy)
+         > x_error_message->first_request))
     XSync (dpy, False);
 
   if (x_error_message->string[0])