[siesta-commit] siesta/lib/Siesta/Storage DBI.pm,1.22,1.23

[prev] [thread] [next] [lurker] [Date index for 2002/09/10]

From: clampr
Subject: [siesta-commit] siesta/lib/Siesta/Storage DBI.pm,1.22,1.23
Date: 20:35 on 10 Sep 2002
Update of /cvsroot/siesta/siesta/lib/Siesta/Storage
In directory usw-pr-cvs1:/tmp/cvs-serv9751

Modified Files:
	DBI.pm 
Log Message:
simpilfy


Index: DBI.pm
===================================================================
RCS file: /cvsroot/siesta/siesta/lib/Siesta/Storage/DBI.pm,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- DBI.pm	10 Sep 2002 19:31:37 -0000	1.22
+++ DBI.pm	10 Sep 2002 19:35:41 -0000	1.23
@@ -66,17 +66,9 @@
     my $self    = shift;
     my $user_id = shift;
 
-    # make sure we've got the id
-    $user_id = ( ref($user_id) ) ? $user_id->id() : $user_id;
-
-    my @returns;
-
-    foreach my $list ( $self->get_lists() ) {
-        push @returns, $list
-          if $self->member_of_list( $list->id(), $user_id );
-    }
+    $user_id = UNIVERSAL::can($user_id, 'id') ? $user_id->id : $user_id;
 
-    return @returns;
+    grep { $self->member_of_list( $_->id, $user_id ) } $self->get_lists;
 }
 
 sub load_user {



Generated at 13:57 on 01 Jul 2004 by mariachi 0.52