From da29de792b5c0604c91bc8eda0c15078c8ab8501 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Thu, 1 Feb 2018 11:03:18 -0500 Subject: eval: Don't unnecessarily zero fields in struct eval_state The designated initializer causes everything not mentioned to be zeroed, a waste of time that shows up on profiles. It also has the potential to hide uninitialized-use bugs. --- eval.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 343c3f7..9bb4f04 100644 --- a/eval.c +++ b/eval.c @@ -1077,13 +1077,12 @@ static enum bftw_action cmdline_callback(struct BFTW *ftwbuf, void *ptr) { const struct cmdline *cmdline = args->cmdline; - struct eval_state state = { - .ftwbuf = ftwbuf, - .cmdline = cmdline, - .action = BFTW_CONTINUE, - .ret = &args->ret, - .quit = &args->quit, - }; + struct eval_state state; + state.ftwbuf = ftwbuf; + state.cmdline = cmdline; + state.action = BFTW_CONTINUE; + state.ret = &args->ret; + state.quit = &args->quit; if (ftwbuf->typeflag == BFTW_ERROR) { if (!eval_should_ignore(&state, ftwbuf->error)) { -- cgit v1.2.3