[Bioperl-guts-l] [15603] bioperl-live/trunk/Bio/DB/SeqFeature/Store/memory.pm: better fix

Lincoln Stein lstein at dev.open-bio.org
Thu Mar 19 18:07:00 EDT 2009


Revision: 15603
Author:   lstein
Date:     2009-03-19 18:06:59 -0400 (Thu, 19 Mar 2009)

Log Message:
-----------
better fix

Modified Paths:
--------------
    bioperl-live/trunk/Bio/DB/SeqFeature/Store/memory.pm

Modified: bioperl-live/trunk/Bio/DB/SeqFeature/Store/memory.pm
===================================================================
--- bioperl-live/trunk/Bio/DB/SeqFeature/Store/memory.pm	2009-03-19 21:58:53 UTC (rev 15602)
+++ bioperl-live/trunk/Bio/DB/SeqFeature/Store/memory.pm	2009-03-19 22:06:59 UTC (rev 15603)
@@ -443,10 +443,8 @@
 
   if (!defined $start or !defined $end or $range_type eq 'contained_in') {
     @bins = sort {$a<=>$b} keys %{$index};
-    # be suspicious of this -- possibly a fencepost error at $end
     $start = $bins[0]  * BINSIZE  unless defined $start;
-    $end   = $bins[-1] * BINSIZE  unless defined $end;
-    $end  += BINSIZE if $start==$end;
+    $end   = @bins == 1 ? BINSIZE : $bins[-1] * BINSIZE  unless defined $end;
   }
   my %seenit;
   my $bin_min       = int $start/BINSIZE;




More information about the Bioperl-guts-l mailing list