Re: [PATCH v4 02/13] column: add API to print items in columns

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

 



Nguyễn Thái Ngọc Duy  <pclouds@xxxxxxxxx> writes:

> +struct string_list_item *add_cell_to_list(struct string_list *list,
> +					  int mode,
> +					  const char *string)
> +{
> +	if (mode & COL_ENABLED)
> +		return string_list_append(list, string);
> +	return NULL;
> +}
> +
> +void print_cell(struct string_list *list, int mode, const char *string)
> +{
> +	if (!add_cell_to_list(list, mode, string))
> +		printf("%s\n", string);
> +}

I find these two functions showing an extremely bad taste in the code
design. "If we for some reason fail to add the string to the list, we
fallback to print it straight away" is the natural reading of this code,
but that is absolutly not the impression the author of this piece of
crap^Wcode wanted to give to its readers.

Am I being too ascestically perfectionist?
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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]