commit 79a6671: [Minor] Optimize the case when there are no finish events

Vsevolod Stakhov vsevolod at highsecure.ru
Sat Jun 22 12:14:42 UTC 2019


Author: Vsevolod Stakhov
Date: 2019-06-20 22:04:11 +0100
URL: https://github.com/rspamd/rspamd/commit/79a6671de054b5f03eb4a9cb9b8851d3e111a295

[Minor] Optimize the case when there are no finish events

---
 src/libserver/worker_util.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/libserver/worker_util.c b/src/libserver/worker_util.c
index cc89c210b..bb15d0407 100644
--- a/src/libserver/worker_util.c
+++ b/src/libserver/worker_util.c
@@ -112,6 +112,11 @@ rspamd_worker_terminate_handlers (struct rspamd_worker *w)
 	static ev_timer margin_call;
 	static int nchecks = 0;
 
+	if (w->finish_actions->len == 0) {
+		/* Nothing to do */
+		return;
+	}
+
 	actx = (struct rspamd_abstract_worker_ctx *)w->ctx;
 
 	/*


More information about the Commits mailing list