We used to pass in db handles; then it shifted to maybe we were passing 
in db handles (or maybe not). And now we don't pass in db handles at all -- so 
remove the code which used to take care of the maybe case. It's no longer 
needed.

        Patch by kareila. 

diffs (38 lines):

diff -r 44a1463f4850 -r ecb4f977c4a1 cgi-bin/ljrelation.pl
--- a/cgi-bin/ljrelation.pl     Mon Jun 28 18:00:21 2010 +0800
+++ b/cgi-bin/ljrelation.pl     Mon Jun 28 18:07:33 2010 +0800
@@ -244,15 +244,13 @@ sub _set_rel_memcache {
 # <LJFUNC>
 # name: LJ::check_rel
 # des: Checks whether two users are in a specified relationship to each other.
-# args: db?, userid, targetid, type
+# args: userid, targetid, type
 # des-userid: source userid, nonzero; may also be a user hash.
 # des-targetid: target userid, nonzero; may also be a user hash.
 # des-type: type of the relationship
 # returns: 1 if the relationship exists, 0 otherwise
 # </LJFUNC>
-sub check_rel
-{
-    my $db = isdb($_[0]) ? shift : undef;
+sub check_rel {
     my ($userid, $targetid, $type) = @_;
     return undef unless $type && $userid && $targetid;
 
@@ -271,14 +269,14 @@ sub check_rel
     return $memval if defined $memval;
 
     # are we working on reluser or reluser2?
-    my $table;
+    my ( $db, $table );
     if ($typeid) {
         # clustered reluser2 table
         $db = LJ::get_cluster_reader($u);
         $table = "reluser2";
     } else {
         # non-clustered reluser table
-        $db ||= LJ::get_db_reader();
+        $db = LJ::get_db_reader();
         $table = "reluser";
     }
 
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to