* MDF [broker] optimize code for performance
@@ -352,16 +352,16 @@ server_cb(void *arg)
work->msg_ret,
cvector_size(work->msg_ret));
for (int i = 0;
- i < cvector_size(work->msg_ret); i++) {
+ i < cvector_size(work->msg_ret) && check_msg_exp(work->msg_ret[i], nng_msg_get_proto_data(work->msg_ret[i])); i++) {
nng_msg *m = work->msg_ret[i];
- property *prop = nng_msg_get_proto_data(m);
- if (check_msg_exp(m, prop)) {
nng_msg_clone(m);
work->msg = m;
- nng_aio_set_msg(work->aio, work->msg);
- nng_msg_set_pipe(work->msg, work->pid);
- nng_ctx_send(work->ctx, work->aio);
- }
+ nng_aio_set_msg(
+ work->aio, work->msg);
+ nng_msg_set_pipe(
+ work->msg, work->pid);
+ nng_ctx_send(
+ work->ctx, work->aio);
}
cvector_free(work->msg_ret);
}
