diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2018-02-01 11:03:18 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2018-02-01 11:20:34 -0500 |
commit | da29de792b5c0604c91bc8eda0c15078c8ab8501 (patch) | |
tree | a073ef8d7bb324126ba6d37c8776f99f126bbe35 | |
parent | 15152c2f2e169e824f8a1da400b8c3a0b195f8f4 (diff) | |
download | bfs-da29de792b5c0604c91bc8eda0c15078c8ab8501.tar.xz |
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.
-rw-r--r-- | eval.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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)) { |