summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2018-02-01 11:03:18 -0500
committerTavian Barnes <tavianator@tavianator.com>2018-02-01 11:20:34 -0500
commitda29de792b5c0604c91bc8eda0c15078c8ab8501 (patch)
treea073ef8d7bb324126ba6d37c8776f99f126bbe35
parent15152c2f2e169e824f8a1da400b8c3a0b195f8f4 (diff)
downloadbfs-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.c13
1 files changed, 6 insertions, 7 deletions
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)) {