Skip to content

Commit

Permalink
lib: io_loop_set_current() - do nothing if ioloop doesn't change
Browse files Browse the repository at this point in the history
There's no need to call the switch callbacks if the ioloop doesn't change.
  • Loading branch information
sirainen authored and GitLab committed Jan 29, 2017
1 parent 5433e85 commit 1f1a967
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/ioloop.c
Expand Up @@ -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)
Expand Down

0 comments on commit 1f1a967

Please sign in to comment.