журнал журнал (shhh) wrote in changelog,
журнал журнал
shhh
changelog

[livejournal] r22598: LJSUP-13239: LJ::User::get_social_capita...

Committer: nnikulochkina
LJSUP-13239: LJ::User::get_social_capital improvement
U   trunk/cgi-bin/LJ/User.pm
Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2012-08-08 11:44:50 UTC (rev 22597)
+++ trunk/cgi-bin/LJ/User.pm	2012-08-08 11:53:10 UTC (rev 22598)
@@ -2891,11 +2891,11 @@
     my ($u) = @_;
 
     my $soc_capital = LJ::MemCache::get( $u->user."_soc_cap" );
-    if ($soc_capital) {
+    if (defined $soc_capital) {
         return $soc_capital;
     } else {  
         $soc_capital = LJ::PersonalStats::DB->fetch_raw('ratings', {func => 'get_authority', journal_id => $u->userid}); 
-        my $value = $soc_capital ? int($soc_capital->{result}->{authority}/1000) : 0;
+        my $value = $soc_capital ? int($soc_capital->{result}->{authority}/1000) : return 0;
         LJ::MemCache::set( $u->user."_soc_cap", $value, 60*60);
         return $value;
     }

Tags: livejournal, nikulochkina, nnikulochkina, pm
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments