Re: [PATCH v3 03/25] sequencer: avoid unnecessary indirection
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 10, 2016, 22:14 UTC
- Message-ID
- <xmqq7f9fdf7a.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <336cefca0bda214b5b43b1094af13d787d1a79e3.1476120229.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 7 quoted lines
> We really do not need the *pointer to a* pointer to the options in > the read_populate_opts() function. > > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> > --- > sequencer.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-)
I vaguely recall seeing this in the previous round and finding it pretty sensible. And I still do ;-)
[the remainder left as-is to help those who are reading from sidelines]
Show 30 quoted lines
> diff --git a/sequencer.c b/sequencer.c
> index cb16cbd..c2fbf6f 100644
> --- a/sequencer.c
> +++ b/sequencer.c
> @@ -813,7 +813,7 @@ static int populate_opts_cb(const char *key, const char *value, void *data)
> return 0;
> }
>
> -static int read_populate_opts(struct replay_opts **opts)
> +static int read_populate_opts(struct replay_opts *opts)
> {
> if (!file_exists(git_path_opts_file()))
> return 0;
> @@ -823,7 +823,7 @@ static int read_populate_opts(struct replay_opts **opts)
> * about this case, though, because we wrote that file ourselves, so we
> * are pretty certain that it is syntactically correct.
> */
> - if (git_config_from_file(populate_opts_cb, git_path_opts_file(), *opts) < 0)
> + if (git_config_from_file(populate_opts_cb, git_path_opts_file(), opts) < 0)
> return error(_("Malformed options sheet: %s"),
> git_path_opts_file());
> return 0;
> @@ -1054,7 +1054,7 @@ static int sequencer_continue(struct replay_opts *opts)
>
> if (!file_exists(git_path_todo_file()))
> return continue_single_pick();
> - if (read_populate_opts(&opts) ||
> + if (read_populate_opts(opts) ||
> read_populate_todo(&todo_list, opts))
> return -1;