Cleanup of several lines of code into one equivalent line.

        Patch by kareila. 

diffs (66 lines):

diff -r 491eaf27c733 -r e513e5d66d7c cgi-bin/LJ/S2/DayPage.pm
--- a/cgi-bin/LJ/S2/DayPage.pm  Thu Sep 24 21:01:08 2009 -0500
+++ b/cgi-bin/LJ/S2/DayPage.pm  Fri Sep 25 12:34:59 2009 -0500
@@ -59,17 +59,7 @@ sub DayPage
         if ($remote->{'userid'} == $u->{'userid'} || $viewall) {
             $secwhere = "";   # see everything
         } elsif ( $remote->is_individual ) {
-
-            # if we're viewing a community, we intuit the security mask from 
the membership
-            my $gmask = 0;
-            if ( $u->is_community ) {
-                $gmask = 1
-                    if $remote->member_of( $u );
-
-            } else {
-                $gmask = $u->trustmask( $remote );
-            }
-
+            my $gmask = $u->is_community ? $remote->member_of( $u ) : 
$u->trustmask( $remote );
             $secwhere = "AND (security='public' OR (security='usemask' AND 
allowmask & $gmask))"
                 if $gmask;
         }
diff -r 491eaf27c733 -r e513e5d66d7c cgi-bin/LJ/S2/MonthPage.pm
--- a/cgi-bin/LJ/S2/MonthPage.pm        Thu Sep 24 21:01:08 2009 -0500
+++ b/cgi-bin/LJ/S2/MonthPage.pm        Fri Sep 25 12:34:59 2009 -0500
@@ -59,17 +59,7 @@ sub MonthPage
         if ($remote->{'userid'} == $u->{'userid'} || $viewall) {
             $secwhere = "";   # see everything
         } elsif ( $remote->is_individual ) {
-
-            # if we're viewing a community, we intuit the security mask from 
the membership
-            my $gmask = 0;
-            if ( $u->is_community ) {
-                $gmask = 1
-                    if $remote->member_of( $u );
-
-            } else {
-                $gmask = $u->trustmask( $remote );
-            }
-
+            my $gmask = $u->is_community ? $remote->member_of( $u ) : 
$u->trustmask( $remote );
             $secwhere = "AND (l.security='public' OR (l.security='usemask' AND 
l.allowmask & $gmask))"
                 if $gmask;
         }
diff -r 491eaf27c733 -r e513e5d66d7c cgi-bin/LJ/User.pm
--- a/cgi-bin/LJ/User.pm        Thu Sep 24 21:01:08 2009 -0500
+++ b/cgi-bin/LJ/User.pm        Fri Sep 25 12:34:59 2009 -0500
@@ -7654,17 +7654,7 @@ sub get_daycounts
             $secwhere = "";   # see everything
             $memkind = 'a'; # all
         } elsif ( $remote->is_individual ) {
-
-            # if we're viewing a community, we intuit the security mask from 
the membership
-            my $gmask = 0;
-            if ( $u->is_community ) {
-                $gmask = 1
-                    if $remote->member_of( $u );
-
-            } else {
-                $gmask = $u->trustmask( $remote );
-            }
-
+            my $gmask = $u->is_community ? $remote->member_of( $u ) : 
$u->trustmask( $remote );
             if ( $gmask ) {
                 $secwhere = "AND (security='public' OR (security='usemask' AND 
allowmask & $gmask))";
                 $memkind = 'g' . $gmask; # friends case: allowmask == gmask == 
1
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to