madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r23073: LJSUP-13883: Journal pages optimizaiton ...

Committer: sbelyaev
LJSUP-13883: Journal pages optimizaiton : stage 1
U   trunk/cgi-bin/ljrelation.pl
Modified: trunk/cgi-bin/ljrelation.pl
===================================================================
--- trunk/cgi-bin/ljrelation.pl	2012-10-09 12:28:27 UTC (rev 23072)
+++ trunk/cgi-bin/ljrelation.pl	2012-10-09 12:29:54 UTC (rev 23073)
@@ -57,7 +57,8 @@
     &nodb;
 
     # get user and journal ids
-    my $uid = LJ::want_userid(shift);
+    my $u = shift;
+    my $uid = LJ::want_userid($u);
     my $jid = LJ::want_userid(shift);
     return 1 unless $uid && $jid;
 
@@ -65,8 +66,12 @@
     # in own journal.  avoid db hit.
     return 0 if ($uid == $jid);
 
+    return $u->{'__cached_relation'}->{$jid}
+        if $u->{'__cached_relation'}->{$jid};
+
     # edge from journal -> user
-    return LJ::check_rel($jid, $uid, 'B');
+    my $relation = LJ::check_rel($jid, $uid, 'B');
+    return $relation
 }
 
 sub get_groupmask

Tags: livejournal, madeon, pl, sbelyaev
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