[Bps-public-commit] r16298 - sd/trunk/lib/App/SD/Replica/rt

ruz at bestpractical.com ruz at bestpractical.com
Tue Oct 14 23:33:55 EDT 2008


Author: ruz
Date: Tue Oct 14 23:33:55 2008
New Revision: 16298

Modified:
   sd/trunk/lib/App/SD/Replica/rt/PullEncoder.pm

Log:
* map in void context is evil, we have foreach for such things

Modified: sd/trunk/lib/App/SD/Replica/rt/PullEncoder.pm
==============================================================================
--- sd/trunk/lib/App/SD/Replica/rt/PullEncoder.pm	(original)
+++ sd/trunk/lib/App/SD/Replica/rt/PullEncoder.pm	Tue Oct 14 23:33:55 2008
@@ -76,13 +76,15 @@
 
     $ticket->{'id'} =~ s/^ticket\///g;
 
-    map { $ticket->{ $self->sync_source->uuid . '-' . lc($_) } = delete $ticket->{$_} }
-        (qw(Queue id));
-    map { delete $ticket->{$_} if ( !defined $ticket->{$_} || $ticket->{$_} eq '' ) } keys %$ticket;
-    map { $ticket->{$_} = $self->date_to_iso( $ticket->{$_} ) }
-        qw(Created Resolved Told LastUpdated Due Starts Started);
-    map { $ticket->{$_} =~ s/ minutes$// if defined $ticket->{$_} }
-        qw(TimeWorked TimeLeft TimeEstimated);
+    $ticket->{ $self->sync_source->uuid . '-' . lc($_) } = delete $ticket->{$_}
+        foreach qw(Queue id);
+    delete $ticket->{$_} foreach
+        grep !defined $ticket->{$_} || $ticket->{$_} eq '',
+        keys %$ticket;
+    $ticket->{$_} = $self->date_to_iso( $ticket->{$_} )
+        foreach qw(Created Resolved Told LastUpdated Due Starts Started);
+    $ticket->{$_} =~ s/ minutes$//
+        foreach grep defined $ticket->{$_}, qw(TimeWorked TimeLeft TimeEstimated);
     $ticket->{'Status'} =~ s/^(resolved|rejected)$/closed/;
     return $ticket;
 }



More information about the Bps-public-commit mailing list