[Bioperl-guts-l] bioperl-live/Bio/Matrix Generic.pm, 1.11, 1.12 IO.pm, 1.2, 1.3 PhylipDist.pm, 1.12, 1.13

Heikki Lehvaslaiho heikki at dev.open-bio.org
Wed Jun 7 05:54:54 EDT 2006


Update of /home/repository/bioperl/bioperl-live/Bio/Matrix
In directory dev.open-bio.org:/tmp/cvs-serv1174/Bio/Matrix

Modified Files:
	Generic.pm IO.pm PhylipDist.pm 
Log Message:
cleaning unnecessary "return undef"s

Index: PhylipDist.pm
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/Matrix/PhylipDist.pm,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** PhylipDist.pm	9 Oct 2005 14:53:14 -0000	1.12
--- PhylipDist.pm	7 Jun 2006 09:54:52 -0000	1.13
***************
*** 440,444 ****
         $ct++;
     }
!    return undef;
  }
  
--- 440,444 ----
         $ct++;
     }
!    return;
  }
  

Index: Generic.pm
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/Matrix/Generic.pm,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Generic.pm	15 Feb 2006 21:03:40 -0000	1.11
--- Generic.pm	7 Jun 2006 09:54:52 -0000	1.12
***************
*** 210,214 ****
     if( ! defined $row || ! defined $column ) {
         $self->throw("Need at least 2 ids");
-        return undef;
     }
  
--- 210,213 ----
***************
*** 252,256 ****
  	$col !~ /^\d+$/ ) {
  	$self->warn("expected to get 2 number for entry_by_num");
! 	return undef;
      }
      
--- 251,255 ----
  	$col !~ /^\d+$/ ) {
  	$self->warn("expected to get 2 number for entry_by_num");
! 	return;
      }
      
***************
*** 289,298 ****
      if( ! defined $column ) {
  	$self->warn("Need at least a column id");
! 	return undef;
      }
      my $colnum  = $self->column_num_for_name($column);
      if( ! defined $colnum ) { 
  	$self->warn("could not find column number for $column");
! 	return undef;
      }
      return $self->column_by_num($colnum,$newcol);
--- 288,297 ----
      if( ! defined $column ) {
  	$self->warn("Need at least a column id");
! 	return;
      }
      my $colnum  = $self->column_num_for_name($column);
      if( ! defined $colnum ) { 
  	$self->warn("could not find column number for $column");
! 	return;
      }
      return $self->column_by_num($colnum,$newcol);
***************
*** 334,338 ****
      if( ! defined $colnum ) {
  	$self->warn("need at least a column number");
! 	return undef;
      }
      my $rowcount = $self->num_rows;
--- 333,337 ----
      if( ! defined $colnum ) {
  	$self->warn("need at least a column number");
! 	return;
      }
      my $rowcount = $self->num_rows;
***************
*** 343,351 ****
  	if( ref($newcol) !~ /ARRAY/i) {
  	    $self->warn("expected a valid arrayref for resetting a column");
! 	    return undef;
  	}
  	if( scalar @$newcol != $rowcount ) {
  	    $self->warn("new column is not the correct length ($rowcount) - call add or remove row to shrink or grow the number of rows first");
! 	    return undef;
  	}
  	for(my $i=0; $i < $rowcount; $i++) {
--- 342,350 ----
  	if( ref($newcol) !~ /ARRAY/i) {
  	    $self->warn("expected a valid arrayref for resetting a column");
! 	    return;
  	}
  	if( scalar @$newcol != $rowcount ) {
  	    $self->warn("new column is not the correct length ($rowcount) - call add or remove row to shrink or grow the number of rows first");
! 	    return;
  	}
  	for(my $i=0; $i < $rowcount; $i++) {
***************
*** 382,386 ****
      if( ! defined $row) {
  	$self->warn("Need at least a row id");
! 	return undef;
      }
      my $rownum = $self->row_num_for_name($row);
--- 381,385 ----
      if( ! defined $row) {
  	$self->warn("Need at least a row id");
! 	return;
      }
      my $rownum = $self->row_num_for_name($row);
***************
*** 419,423 ****
     if( ! defined $rownum ) {
         $self->warn("need at least a row number");
!        return undef;
     }
      my $colcount = $self->num_columns;
--- 418,422 ----
     if( ! defined $rownum ) {
         $self->warn("need at least a row number");
!        return;
     }
      my $colcount = $self->num_columns;
***************
*** 426,434 ****
  	if( ref($newrow) !~ /ARRAY/i) {
  	    $self->warn("expected a valid arrayref for resetting a row");
! 	    return undef;
  	}
  	if( scalar @$newrow != $colcount ) {
  	    $self->warn("new row is not the correct length ($colcount) - call add or remove column to shrink or grow the number of columns first");
! 	    return undef;
  	}
  	for(my $i=0; $i < $colcount; $i++) {
--- 425,433 ----
  	if( ref($newrow) !~ /ARRAY/i) {
  	    $self->warn("expected a valid arrayref for resetting a row");
! 	    return;
  	}
  	if( scalar @$newrow != $colcount ) {
  	    $self->warn("new row is not the correct length ($colcount) - call add or remove column to shrink or grow the number of columns first");
! 	    return;
  	}
  	for(my $i=0; $i < $colcount; $i++) {
***************
*** 497,507 ****
         $index !~ /^\d+$/ ) {
         $self->warn("expected a valid row index in add_row");
!        return undef;
     } elsif( ! defined $name) {
         $self->warn("Need a row name or heading");
!        return undef;
     } elsif( defined $self->row_num_for_name($name) ) {
         $self->warn("Need a unqiue name for the column heading, $name is already used");
!        return undef;
     }
     my $colcount = $self->num_columns;
--- 496,506 ----
         $index !~ /^\d+$/ ) {
         $self->warn("expected a valid row index in add_row");
!        return;
     } elsif( ! defined $name) {
         $self->warn("Need a row name or heading");
!        return;
     } elsif( defined $self->row_num_for_name($name) ) {
         $self->warn("Need a unqiue name for the column heading, $name is already used");
!        return;
     }
     my $colcount = $self->num_columns;
***************
*** 587,597 ****
         $index !~ /^\d+$/ ) {
         $self->warn("expected a valid col index in add_column");
!        return undef;
     } elsif( ! defined $name) {
         $self->warn("Need a column name or heading");
!        return undef;
     } elsif( defined $self->column_num_for_name($name) ) {
         $self->warn("Need a unqiue name for the column heading, $name is already used");
!        return undef;
     }
     my $colcount = $self->num_columns;
--- 586,596 ----
         $index !~ /^\d+$/ ) {
         $self->warn("expected a valid col index in add_column");
!        return;
     } elsif( ! defined $name) {
         $self->warn("Need a column name or heading");
!        return;
     } elsif( defined $self->column_num_for_name($name) ) {
         $self->warn("Need a unqiue name for the column heading, $name is already used");
!        return;
     }
     my $colcount = $self->num_columns;

Index: IO.pm
===================================================================
RCS file: /home/repository/bioperl/bioperl-live/Bio/Matrix/IO.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** IO.pm	8 Sep 2003 12:17:12 -0000	1.2
--- IO.pm	7 Jun 2006 09:54:52 -0000	1.3
***************
*** 109,113 ****
  
  	# normalize capitalization
! 	return undef unless( $class->_load_format_module($format) );
  	return "Bio::Matrix::IO::$format"->new(@args);
      }
--- 109,113 ----
  
  	# normalize capitalization
! 	return unless( $class->_load_format_module($format) );
  	return "Bio::Matrix::IO::$format"->new(@args);
      }



More information about the Bioperl-guts-l mailing list