pgsql: Remove redundant SvOK() tests in plperl.

Поиск
Список
Период
Сортировка
Искать

pgsql: Remove redundant SvOK() tests in plperl.

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Remove redundant SvOK() tests in plperl.

I noticed that some places in our code test "SvOK(sv) && SvROK(sv)"
while others check just SvROK(sv).  On investigation, it's clear
that SvROK implies SvOK so testing both is pointless.  While removing
these extra checks seems very unlikely to make any performance
difference, it does make the code more consistent and intelligible.

Also mop up a couple of places where there wasn't a null-pointer
check before a SvOK() test.  I think these are unreachable cases,
but in the name of consistency let's do it the same everywhere.

Author: Tom Lane 
Reviewed-by: Andrey Rachitskiy 
Discussion: https://postgr.es/m/2034677.1787172042@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/41868e8aaa6cfff63b1c8010e1356e01d86a1326

Modified Files
--------------
src/pl/plperl/plperl.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)

FAQ