lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [lucy-commits] svn commit: r1059226 - in /incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl: Constructor.pm Method.pm
Date Sat, 15 Jan 2011 02:08:35 GMT
Author: marvin
Date: Sat Jan 15 02:08:35 2011
New Revision: 1059226

URL: http://svn.apache.org/viewvc?rev=1059226&view=rev
Log:
LUCY_INCREF() already performs a NULL check, so remove a redundant
NULL-checking wrapper.

Modified:
    incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/Constructor.pm
    incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/Method.pm

Modified: incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/Constructor.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/Constructor.pm?rev=1059226&r1=1059225&r2=1059226&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/Constructor.pm (original)
+++ incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/Constructor.pm Sat Jan 15 02:08:35
2011
@@ -103,7 +103,7 @@ sub xsub_def {
 
         # Compensate for the fact that the method will swallow a refcount.
         if ( $type->is_object and $type->decremented ) {
-            push @refcount_mods, "if ($name) { LUCY_INCREF($name); }";
+            push @refcount_mods, "LUCY_INCREF($name);";
         }
     }
     $allot_params .= "        NULL);";

Modified: incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/Method.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/Method.pm?rev=1059226&r1=1059225&r2=1059226&view=diff
==============================================================================
--- incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/Method.pm (original)
+++ incubator/lucy/trunk/clownfish/lib/Clownfish/Binding/Perl/Method.pm Sat Jan 15 02:08:35
2011
@@ -75,7 +75,7 @@ sub _xsub_body {
         next unless $arg_type->is_object;
         next unless $arg_type->decremented;
         my $var_name = $arg_var->micro_sym;
-        $body .= "if ($var_name) (void)LUCY_INCREF($var_name);\n    ";
+        $body .= "LUCY_INCREF($var_name);\n    ";
     }
 
     if ( $method->void ) {



Mime
View raw message