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 <[email protected]>
Reviewed-by: Andrey Rachitskiy <[email protected]>
Discussion: https://postgr.es/m/[email protected]

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(-)

Reply via email to