From baebd1593ecb084789c8f9e750ac1b88db70501a Mon Sep 17 00:00:00 2001 From: Kenichi Ishigaki Date: Tue, 21 Jul 2009 18:00:16 +0000 Subject: [PATCH] DBD-SQLite: make it shorter --- dbdimp.c | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/dbdimp.c b/dbdimp.c index a48feed..0350187 100644 --- a/dbdimp.c +++ b/dbdimp.c @@ -1523,30 +1523,10 @@ sqlite_db_authorizer_dispatcher ( XPUSHs( sv_2mortal ( newSViv ( action_code ) ) ); /* these ifs are ugly but without them, perl 5.8 segfaults */ - if (details_1 == NULL) { - XPUSHs( sv_2mortal( &PL_sv_undef ) ); - } - else { - XPUSHs( sv_2mortal ( newSVpv ( details_1, 0 ) ) ); - } - if (details_2 == NULL) { - XPUSHs( sv_2mortal( &PL_sv_undef ) ); - } - else { - XPUSHs( sv_2mortal ( newSVpv ( details_2, 0 ) ) ); - } - if (details_3 == NULL) { - XPUSHs( sv_2mortal( &PL_sv_undef ) ); - } - else { - XPUSHs( sv_2mortal ( newSVpv ( details_3, 0 ) ) ); - } - if (details_4 == NULL) { - XPUSHs( sv_2mortal( &PL_sv_undef ) ); - } - else { - XPUSHs( sv_2mortal ( newSVpv ( details_4, 0 ) ) ); - } + XPUSHs( sv_2mortal( details_1 ? newSVpv( details_1, 0 ) : &PL_sv_undef ) ); + XPUSHs( sv_2mortal( details_2 ? newSVpv( details_2, 0 ) : &PL_sv_undef ) ); + XPUSHs( sv_2mortal( details_3 ? newSVpv( details_3, 0 ) : &PL_sv_undef ) ); + XPUSHs( sv_2mortal( details_4 ? newSVpv( details_4, 0 ) : &PL_sv_undef ) ); PUTBACK; n_retval = call_sv(authorizer, G_SCALAR);