[Xcb-commit] xcb

Jamey Sharp jamey at kemper.freedesktop.org
Thu Apr 20 15:16:28 PDT 2006


 xcb/src/xcb_in.c  |   22 ++++++++++------------
 xcb/src/xcb_out.c |    3 ++-
 2 files changed, 12 insertions(+), 13 deletions(-)

New commits:
diff-tree d91e9c9de974b8b517ad289a30de5246a3855016 (from adaaf459fa4be95a51ec95a4b8baa0267da28cf4)
Author: Jamey Sharp <jamey at minilop.net>
Date:   Thu Apr 20 11:51:01 2006 -0700

    Minor performance improvement: do not call _xcb_in_expect_reply unless it is needed. It is not often needed.

diff --git a/xcb/src/xcb_in.c b/xcb/src/xcb_in.c
index ecacb99..3bf54f3 100644
--- a/xcb/src/xcb_in.c
+++ b/xcb/src/xcb_in.c
@@ -443,18 +443,16 @@ void _xcb_in_destroy(_xcb_in *in)
 
 int _xcb_in_expect_reply(XCBConnection *c, unsigned int request, enum workarounds workaround, int flags)
 {
-    if(workaround != WORKAROUND_NONE || flags != 0)
-    {
-        pending_reply *pend = malloc(sizeof(pending_reply));
-        if(!pend)
-            return 0;
-        pend->request = request;
-        pend->workaround = workaround;
-        pend->flags = flags;
-        pend->next = 0;
-        *c->in.pending_replies_tail = pend;
-        c->in.pending_replies_tail = &pend->next;
-    }
+    pending_reply *pend = malloc(sizeof(pending_reply));
+    assert(workaround != WORKAROUND_NONE || flags != 0);
+    if(!pend)
+        return 0;
+    pend->request = request;
+    pend->workaround = workaround;
+    pend->flags = flags;
+    pend->next = 0;
+    *c->in.pending_replies_tail = pend;
+    c->in.pending_replies_tail = &pend->next;
     return 1;
 }
 
diff --git a/xcb/src/xcb_out.c b/xcb/src/xcb_out.c
index eb41e59..2667973 100644
--- a/xcb/src/xcb_out.c
+++ b/xcb/src/xcb_out.c
@@ -165,7 +165,8 @@ unsigned int XCBSendRequest(XCBConnectio
 
     request = ++c->out.request;
     assert(request != 0);
-    _xcb_in_expect_reply(c, request, workaround, flags);
+    if(workaround != WORKAROUND_NONE || flags != 0)
+        _xcb_in_expect_reply(c, request, workaround, flags);
     if(!req->isvoid)
         c->in.request_expected = c->out.request;
 


More information about the xcb-commit mailing list