Author: tim.bunce
Date: Fri Jan  2 14:13:17 2009
New Revision: 657

Modified:
    trunk/lib/Devel/NYTProf/SubInfo.pm

Log:
Avoid undef warnings from $si->merge_in(...)


Modified: trunk/lib/Devel/NYTProf/SubInfo.pm
==============================================================================
--- trunk/lib/Devel/NYTProf/SubInfo.pm  (original)
+++ trunk/lib/Devel/NYTProf/SubInfo.pm  Fri Jan  2 14:13:17 2009
@@ -81,8 +81,10 @@
      my $self = shift;
      my $new = shift;

-    $self->[NYTP_SIi_FIRST_LINE]  = min($self->[NYTP_SIi_FIRST_LINE],  
$new->[NYTP_SIi_FIRST_LINE]);
-    $self->[NYTP_SIi_LAST_LINE]   = max($self->[NYTP_SIi_LAST_LINE],   
$new->[NYTP_SIi_LAST_LINE]);
+    $self->[NYTP_SIi_FIRST_LINE]  = min($self->[NYTP_SIi_FIRST_LINE],  
$new->[NYTP_SIi_FIRST_LINE])
+        if defined $new->[NYTP_SIi_FIRST_LINE];
+    $self->[NYTP_SIi_LAST_LINE]   = max($self->[NYTP_SIi_LAST_LINE],   
$new->[NYTP_SIi_LAST_LINE])
+        if defined $new->[NYTP_SIi_LAST_LINE];
      $self->[NYTP_SIi_CALL_COUNT] += $new->[NYTP_SIi_CALL_COUNT];
      $self->[NYTP_SIi_INCL_RTIME] += $new->[NYTP_SIi_INCL_RTIME];
      $self->[NYTP_SIi_EXCL_RTIME] += $new->[NYTP_SIi_EXCL_RTIME];

--~--~---------~--~----~------------~-------~--~----~
You've received this message because you are subscribed to
the Devel::NYTProf Development User group.

Group hosted at:  http://groups.google.com/group/develnytprof-dev
Project hosted at:  http://perl-devel-nytprof.googlecode.com
CPAN distribution:  http://search.cpan.org/dist/Devel-NYTProf

To post, email:  [email protected]
To unsubscribe, email:  [email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to