diff options
| author | tmu <tmu> | 2002-02-27 09:20:33 +0000 |
|---|---|---|
| committer | tmu <tmu> | 2002-02-27 09:20:33 +0000 |
| commit | 8aec3cbb5bef8b9f145c09dd81b0b862c64b46ea (patch) | |
| tree | 7afc0da369e74f1078d5cb7e936f3dcb03ea619b /fml/lib/File/Sequence.pm | |
| parent | a7f2469eebd57e71281ebf28f78998ce6a9de9e8 (diff) | |
| download | fml8-reply-message-base.tar.gz fml8-reply-message-base.tar.bz2 fml8-reply-message-base.zip | |
work and bugfix _search_max_id_from_top()reply-message-base
Diffstat (limited to 'fml/lib/File/Sequence.pm')
| -rw-r--r-- | fml/lib/File/Sequence.pm | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/fml/lib/File/Sequence.pm b/fml/lib/File/Sequence.pm index e9f582af..2ee89b1a 100644 --- a/fml/lib/File/Sequence.pm +++ b/fml/lib/File/Sequence.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Sequence.pm,v 1.19 2002/02/17 03:13:49 fukachan Exp $ +# $FML: Sequence.pm,v 1.20 2002/02/20 11:53:22 tmu Exp $ # package File::Sequence; @@ -226,9 +226,13 @@ sub search_max_id return $max; } - # old style, search max from bottom (e.g. 0 or 1) + # old style, search max from bottom or top (e.g. 0 or 1) elsif (defined $args->{ hash }) { - $self->_search_max_id_from_bottom($args); + if($self->get_id() > 0) { + $self->_search_max_id_from_top($args); + } else { + $self->_search_max_id_from_bottom($args); + } } else { warn("no argument"); @@ -294,16 +298,17 @@ sub _search_max_id_from_top PEBOT_SEARCH: while ($pebot > 0) { last PEBOT_SEARCH if defined $hash->{ $pebot - $unit }; + last PEBOT_SEARCH if(($pebot - $unit) <= 0); $pebot -= $unit; print STDERR "1. ", $pebot, "\n" if defined $ENV{'debug'}; } # decrement by 1. - do { + while(! defined $hash->{ $pebot - 1 }) { $pebot--; return 0 if($pebot <= 0); print STDERR "2. ", $pebot, "\n" if defined $ENV{'debug'}; - } unless (defined $hash->{ $pebot - 1 }); + } return $pebot; |
