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

Kirill Shcherbatov kshcherbatov at tarantool.org
Tue Aug 13 11:28:16 MSK 2019


>> 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.




More information about the Tarantool-patches mailing list