Minor performance improvement: do not call _xcb_in_expect_reply unless it is needed. It is not often needed.
This commit is contained in:
parent
8953a14f2b
commit
771761ccaa
|
@ -442,10 +442,9 @@ void _xcb_in_destroy(_xcb_in *in)
|
||||||
}
|
}
|
||||||
|
|
||||||
int _xcb_in_expect_reply(XCBConnection *c, unsigned int request, enum workarounds workaround, int flags)
|
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));
|
pending_reply *pend = malloc(sizeof(pending_reply));
|
||||||
|
assert(workaround != WORKAROUND_NONE || flags != 0);
|
||||||
if(!pend)
|
if(!pend)
|
||||||
return 0;
|
return 0;
|
||||||
pend->request = request;
|
pend->request = request;
|
||||||
|
@ -454,7 +453,6 @@ int _xcb_in_expect_reply(XCBConnection *c, unsigned int request, enum workaround
|
||||||
pend->next = 0;
|
pend->next = 0;
|
||||||
*c->in.pending_replies_tail = pend;
|
*c->in.pending_replies_tail = pend;
|
||||||
c->in.pending_replies_tail = &pend->next;
|
c->in.pending_replies_tail = &pend->next;
|
||||||
}
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -165,6 +165,7 @@ unsigned int XCBSendRequest(XCBConnection *c, int flags, struct iovec *vector, c
|
||||||
|
|
||||||
request = ++c->out.request;
|
request = ++c->out.request;
|
||||||
assert(request != 0);
|
assert(request != 0);
|
||||||
|
if(workaround != WORKAROUND_NONE || flags != 0)
|
||||||
_xcb_in_expect_reply(c, request, workaround, flags);
|
_xcb_in_expect_reply(c, request, workaround, flags);
|
||||||
if(!req->isvoid)
|
if(!req->isvoid)
|
||||||
c->in.request_expected = c->out.request;
|
c->in.request_expected = c->out.request;
|
||||||
|
|
Loading…
Reference in New Issue