mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Speed up invoke_callbacks on evbuffers when there are no callbacks
This fixes a performance regression against 1.4
This commit is contained in:
parent
e050703d47
commit
f87f56894d
5
buffer.c
5
buffer.c
@ -447,6 +447,11 @@ evbuffer_run_callbacks(struct evbuffer *buffer, int running_deferred)
|
||||
static inline void
|
||||
evbuffer_invoke_callbacks(struct evbuffer *buffer)
|
||||
{
|
||||
if (TAILQ_EMPTY(&buffer->callbacks)) {
|
||||
buffer->n_add_for_cb = buffer->n_del_for_cb = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (buffer->deferred_cbs) {
|
||||
if (buffer->deferred.queued)
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user