r40197 - in /branches/upstream/libdatetime-set-perl/current: Changes META.yml lib/DateTime/Set.pm
ansgar-guest at users.alioth.debian.org
ansgar-guest at users.alioth.debian.org
Sun Jul 19 20:17:50 UTC 2009
Author: ansgar-guest
Date: Sun Jul 19 20:17:19 2009
New Revision: 40197
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=40197
Log:
[svn-upgrade] Integrating new upstream version, libdatetime-set-perl (0.28)
Modified:
branches/upstream/libdatetime-set-perl/current/Changes
branches/upstream/libdatetime-set-perl/current/META.yml
branches/upstream/libdatetime-set-perl/current/lib/DateTime/Set.pm
Modified: branches/upstream/libdatetime-set-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-set-perl/current/Changes?rev=40197&op=diff
==============================================================================
--- branches/upstream/libdatetime-set-perl/current/Changes (original)
+++ branches/upstream/libdatetime-set-perl/current/Changes Sun Jul 19 20:17:19 2009
@@ -1,4 +1,8 @@
Changes for DateTime::Set
+
+0.28 2009-07-19
+- optimized DateTime::Set->as_list().
+ This works around a segfault reported by Nils Grunwald.
0.27 2009-04-02
- fixed DateTime::Spanset duration() method.
Modified: branches/upstream/libdatetime-set-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-set-perl/current/META.yml?rev=40197&op=diff
==============================================================================
--- branches/upstream/libdatetime-set-perl/current/META.yml (original)
+++ branches/upstream/libdatetime-set-perl/current/META.yml Sun Jul 19 20:17:19 2009
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: DateTime-Set
-version: 0.27
+version: 0.28
abstract: DateTime set objects
license: ~
author:
Modified: branches/upstream/libdatetime-set-perl/current/lib/DateTime/Set.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdatetime-set-perl/current/lib/DateTime/Set.pm?rev=40197&op=diff
==============================================================================
--- branches/upstream/libdatetime-set-perl/current/lib/DateTime/Set.pm (original)
+++ branches/upstream/libdatetime-set-perl/current/lib/DateTime/Set.pm Sun Jul 19 20:17:19 2009
@@ -16,7 +16,7 @@
use constant NEG_INFINITY => -1 * (100 ** 100 ** 100);
BEGIN {
- $VERSION = '0.27';
+ $VERSION = '0.28';
}
@@ -488,7 +488,6 @@
return $dt2;
}
-
sub as_list {
my $self = shift;
return undef unless ref( $self->{set} );
@@ -511,16 +510,22 @@
$set->min->is_infinite;
my @result;
- # we should extract _copies_ of the set elements,
- # such that the user can't modify the set indirectly
-
- my $iter = $set->iterator;
- while ( my $dt = $iter->next )
- {
- push @result, $dt
- if ref( $dt ); # we don't want to return INFINITY value
- };
-
+ my $next = $self->min;
+ if ( $span ) {
+ my $next1 = $span->min;
+ $next = $next1 if $next1 && $next1 > $next;
+ $next = $self->current( $next );
+ }
+ my $last = $self->max;
+ if ( $span ) {
+ my $last1 = $span->max;
+ $last = $last1 if $last1 && $last1 < $last;
+ }
+ do {
+ push @result, $next if !$span || $span->contains($next);
+ $next = $self->next( $next );
+ }
+ while $next && $next <= $last;
return @result;
}
More information about the Pkg-perl-cvs-commits
mailing list