From: Po Lu Date: Tue, 31 May 2022 12:56:43 +0000 (+0800) Subject: Slightly optimize x_check_errors as well X-Git-Tag: emacs-29.0.90~1910^2~315 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=90957dfb7a21528b19f587b1aa64752f5f2f194e;p=emacs.git Slightly optimize x_check_errors as well * src/xterm.c (x_check_errors): Don't sync if no requests were made since the error trap was installed. --- diff --git a/src/xterm.c b/src/xterm.c index fb7d18a53fb..7235a1e9599 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -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])