[tarantool-patches] Re: [PATCH v2 3/8] sql: wrap all trim functions in dispatcher

n.pettik korablev at tarantool.org
Wed Aug 14 01:19:55 MSK 2019



> On 13 Aug 2019, at 11:28, Kirill Shcherbatov <kshcherbatov at tarantool.org> wrote:
> 
>>> A new dispatcher function trim_func calls corresponding trim_
>>> function implementation in relation with number of argc - a count
>>> of arguments.
>>> 
>>> This is an important stem to get rid of function's name
>> 
>> Nit: stem -> step
> 
>>> +
>>> +/**
>>> + * Normalize args from @a argv input array when it has one,
>>> + * two or three args.
>>> + *
>>> + * This is a dispatcher function that call corresponding
>> 
>> Nit: call -> calls
> Fixed.
> 
>>> +	switch (argc) {
>>> +	case 1:
>>> +		trim_func_one_arg(context, argc, argv);
>> 
>> Why not unpack arguments right here?
>> IMHO it would look much better.
> Can't understand, what do you mean? Those functions are static and would be
> inlined. They handle own corner case. Moreover, if I would unpack values externally,
> I need to pass three values (type, size, value) for each argument.

Already replied in PM, but anyway copy answer here:

I want you to get rid of argc and explicitly pass
one, two or three args of struct Mem/strcut sql_value
type to corresponding functions.





More information about the Tarantool-patches mailing list