diff options
author | Eliseo MartÃnez <eliseomarmol@gmail.com> | 2015-04-17 21:09:15 -0400 |
---|---|---|
committer | John Szakmeister <john@szakmeister.net> | 2015-04-18 04:37:09 -0400 |
commit | f03780c1b86af0fd3cc936f21d38788e4231c886 (patch) | |
tree | 19a151ac361ec8bba131baaf796b113f92851a3d | |
parent | 2cbe7005c2498393651d486f74c908654b7addfa (diff) | |
download | rneovim-f03780c1b86af0fd3cc936f21d38788e4231c886.tar.gz rneovim-f03780c1b86af0fd3cc936f21d38788e4231c886.tar.bz2 rneovim-f03780c1b86af0fd3cc936f21d38788e4231c886.zip |
Fix an uninitialized variable warning for call_start.
-rw-r--r-- | src/nvim/eval.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index d6a8351330..1392a12b2d 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -19086,15 +19086,26 @@ call_user_func ( --no_wait_return; } } + + bool func_not_yet_profiling_but_should = + do_profiling == PROF_YES + && !fp->uf_profiling && has_profiling(FALSE, fp->uf_name, NULL); + + if (func_not_yet_profiling_but_should) + func_do_profile(fp); + + bool func_or_func_caller_profiling = + do_profiling == PROF_YES + && (fp->uf_profiling + || (fc->caller != NULL && fc->caller->func->uf_profiling)); + + if (func_or_func_caller_profiling) { + ++fp->uf_tm_count; + call_start = profile_start(); + fp->uf_tm_children = profile_zero(); + } + if (do_profiling == PROF_YES) { - if (!fp->uf_profiling && has_profiling(FALSE, fp->uf_name, NULL)) - func_do_profile(fp); - if (fp->uf_profiling - || (fc->caller != NULL && fc->caller->func->uf_profiling)) { - ++fp->uf_tm_count; - call_start = profile_start(); - fp->uf_tm_children = profile_zero(); - } script_prof_save(&wait_start); } @@ -19117,9 +19128,7 @@ call_user_func ( rettv->vval.v_number = -1; } - if (do_profiling == PROF_YES && (fp->uf_profiling - || (fc->caller != NULL && - fc->caller->func->uf_profiling))) { + if (func_or_func_caller_profiling) { call_start = profile_end(call_start); call_start = profile_sub_wait(wait_start, call_start); fp->uf_tm_total = profile_add(fp->uf_tm_total, call_start); |