[PATCH v4 04/14] box: introduce tuple_format_add_key_part
Vladimir Davydov
vdavydov.dev at gmail.com
Mon Oct 15 22:39:08 MSK 2018
On Thu, Oct 11, 2018 at 10:58:49AM +0300, Kirill Shcherbatov wrote:
> diff --git a/src/box/tuple_format.c b/src/box/tuple_format.c
> index 5679cad..d8acaa5 100644
> --- a/src/box/tuple_format.c
> +++ b/src/box/tuple_format.c
> @@ -42,6 +42,71 @@ static const struct tuple_field tuple_field_default = {
> };
>
> /**
> + * Add and initialize a new key_part to format.
> + * @param format Format to initialize.
> + * @param fields Fields definition if any.
> + * @param fields_count Count of @fields.
> + * @param part An index part to append.
> + * @param is_sequential Does this part sequential.
> + * @param current_slot Pointer to last offset slot.
> + * @retval -1 On error.
> + * @retval 0 On success.
> + */
A doxygen comment is not needed here, because this is a static function
needed solely to reduce the indentation level of tuple_format_create.
Moreover, all those parameter descirptions simply repeat argument names
and hence useless. At the same time the comment itself is misleading and
incomplete: what is "initialize a new key_part to format" supposed to
mean? Does this function initialize the given key part? No, it doesn't
touch it. Please elaborate.
> +static int
> +tuple_format_add_key_part(struct tuple_format *format,
> + const struct field_def *fields, uint32_t field_count,
> + const struct key_part *part, bool is_sequential,
> + int *current_slot)
More information about the Tarantool-patches
mailing list