From: Volker Lendecke Date: Fri, 22 Jul 2016 14:06:45 +0000 (+0200) Subject: tevent: Save 32 bytes of .text in tevent_req_create X-Git-Tag: tdb-1.3.10~180 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4110d73c3c53ca5cf87e3a34dc65d1835a49b57d;p=thirdparty%2Fsamba.git tevent: Save 32 bytes of .text in tevent_req_create This is one of or hottest code paths, I think every bit counts here. Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher --- diff --git a/lib/tevent/tevent_req.c b/lib/tevent/tevent_req.c index c86fb68f801..2d9cc6db574 100644 --- a/lib/tevent/tevent_req.c +++ b/lib/tevent/tevent_req.c @@ -69,11 +69,14 @@ struct tevent_req *_tevent_req_create(TALLOC_CTX *mem_ctx, if (req == NULL) { return NULL; } - ZERO_STRUCTP(req); - req->internal.private_type = type; - req->internal.create_location = location; - req->internal.state = TEVENT_REQ_IN_PROGRESS; - req->internal.trigger = tevent_create_immediate(req); + + *req = (struct tevent_req) { + .internal.private_type = type, + .internal.create_location = location, + .internal.state = TEVENT_REQ_IN_PROGRESS, + .internal.trigger = tevent_create_immediate(req) + }; + if (!req->internal.trigger) { talloc_free(req); return NULL;