summaryrefslogtreecommitdiff
path: root/src/xcb_in.c
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2006-04-20 11:51:01 -0700
committerJamey Sharp <jamey@minilop.net>2006-04-20 11:51:01 -0700
commit771761ccaad31d029d470dde84279e94494310b6 (patch)
treebb8cd4b547f0ee75f1a90a18dc16e3e9908a1fdc /src/xcb_in.c
parent8953a14f2b1518042ed0745574e22fa2adfb6cac (diff)
Minor performance improvement: do not call _xcb_in_expect_reply unless it is needed. It is not often needed.
Diffstat (limited to 'src/xcb_in.c')
-rw-r--r--src/xcb_in.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/xcb_in.c b/src/xcb_in.c
index ecacb99..3bf54f3 100644
--- a/src/xcb_in.c
+++ b/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;
}