summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2016-07-22 16:06:45 +0200
committerVolker Lendecke <vl@samba.org>2016-07-22 19:52:14 +0200
commit4110d73c3c53ca5cf87e3a34dc65d1835a49b57d (patch)
treebfa0537b83943a3e1326e647576b230403244382
parent281b73f124dce47cb17b2e83b880fbba17daca5b (diff)
downloadsamba-4110d73c3c53ca5cf87e3a34dc65d1835a49b57d.tar.gz
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 <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--lib/tevent/tevent_req.c13
1 files changed, 8 insertions, 5 deletions
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;