Re: turn fastgetattr and heap_getattr to inline functions

Поиск
Список
Период
Сортировка
Искать
От
Peter Eisentraut
Тема
Re: turn fastgetattr and heap_getattr to inline functions
Дата
Msg-id
81552967-c388-711a-6f6b-fba631690440@enterprisedb.com
Ответ на
Список
Дерево обсуждения
turn fastgetattr and heap_getattr to inline functions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: turn fastgetattr and heap_getattr to inline functions Michael Paquier <michael@paquier.xyz>
Re: turn fastgetattr and heap_getattr to inline functions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: turn fastgetattr and heap_getattr to inline functions Japin Li <japinli@hotmail.com>
Re: turn fastgetattr and heap_getattr to inline functions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: turn fastgetattr and heap_getattr to inline functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: turn fastgetattr and heap_getattr to inline functions Japin Li <japinli@hotmail.com>
Re: turn fastgetattr and heap_getattr to inline functions Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: turn fastgetattr and heap_getattr to inline functions Japin Li <japinli@hotmail.com>
Re: turn fastgetattr and heap_getattr to inline functions Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: turn fastgetattr and heap_getattr to inline functions Alvaro Herrera <alvherre@alvh.no-ip.org>
On 24.03.22 15:32, Alvaro Herrera wrote:
>> +static inline Datum
>> +heap_getattr(HeapTuple tup, int attnum, TupleDesc tupleDesc, bool *isnull)
>> +{
>> +	if (attnum > 0)
>> +	{
>> +		if (attnum > (int) HeapTupleHeaderGetNatts(tup->t_data))
>> +			return getmissingattr(tupleDesc, attnum, isnull);
>> +		else
>> +			return fastgetattr(tup, attnum, tupleDesc, isnull);
>> +	}
>> +
>> +	return heap_getsysattr(tup, attnum, tupleDesc, isnull);
>> +}
> That was the first thing I wrote, but I can't get myself to like it.
> For this one function the code flow is obvious enough; but if you apply
> the same idea to fastgetattr(), the result is not nice at all.

I like your first patch.  That is more of a functional style, whereas 
the above is more of a procedural style.



В списке pgsql-hackers по дате отправления
От: Peter Eisentraut
Дата:
От: Robert Haas
Дата:
Сообщение: Re: role self-revocation
FAQ