Re: [PATCH v2 3/5] urlmatch.[ch]: add and use URLMATCH_CONFIG_INIT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ævar Arnfjörð Bjarmason  <avarab@xxxxxxxxx> writes:

> @@ -575,11 +575,10 @@ static int get_urlmatch(const char *var, const char *url)
>  	int ret;
>  	char *section_tail;
>  	struct string_list_item *item;
> -	struct urlmatch_config config = { STRING_LIST_INIT_DUP };
> +	struct urlmatch_config config = URLMATCH_CONFIG_INIT;

While I think this is much easier to follow than the original, I am
not quite sure about the removal of these explicit _assignments_ in
code, like this ...

>  	config.collect_fn = urlmatch_collect_fn;
> -	config.cascade_fn = NULL;
>  	config.cb = &values;

and this ...

>  	config.section = "credential";
> -	config.key = NULL;
>  	config.collect_fn = credential_config_callback;
> -	config.cascade_fn = NULL;
>  	config.select_fn = select_all;

and this ...

>  	config.section = "http";
> -	config.key = NULL;
>  	config.collect_fn = http_options;
>  	config.cascade_fn = git_default_config;
> -	config.cb = NULL;

as they have documentation value (e.g. "for this invocation I do
want to use no cascade_fn" is a statement worth making, by having
it next to the assignment to .collect_fn member).





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux