]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: io_loop_set_current() - do nothing if ioloop doesn't change
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 27 Jan 2017 19:36:14 +0000 (21:36 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 30 Jan 2017 09:47:19 +0000 (11:47 +0200)
There's no need to call the switch callbacks if the ioloop doesn't change.

src/lib/ioloop.c

index 22f03a4a2f4897a02b11ac3a8e6418a962f52c00..89c0e98714dd93b118ef72e8078f257accd68938 100644 (file)
@@ -779,6 +779,9 @@ void io_loop_set_current(struct ioloop *ioloop)
        io_switch_callback_t *const *callbackp;
        struct ioloop *prev_ioloop = current_ioloop;
 
+       if (ioloop == current_ioloop)
+               return;
+
        current_ioloop = ioloop;
        if (array_is_created(&io_switch_callbacks)) {
                array_foreach(&io_switch_callbacks, callbackp)