vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r15110: LJSUP-4179: remove "my $x if cond()" con...

Committer: vad
LJSUP-4179: remove "my $x if cond()" construction.

U   trunk/bin/ljsysban.pl
U   trunk/bin/maint/synsuck.pl
Modified: trunk/bin/ljsysban.pl
===================================================================
--- trunk/bin/ljsysban.pl	2009-04-08 07:33:06 UTC (rev 15109)
+++ trunk/bin/ljsysban.pl	2009-04-08 07:35:22 UTC (rev 15110)
@@ -227,8 +227,7 @@
     $dbh->do("UPDATE sysban SET " . join(", ", @set) . " WHERE banid=?", undef, $ban->{'banid'});
 
     # log in statushistory
-    my $msg; map { $msg .= " " if $msg;
-                   $msg .= "$_=$ban->{$_};" }  qw(banid status bandate banuntil what value note);
+    my $msg = join " " => (map {"$_=$ban->{$_};"}  qw(banid status bandate banuntil what value note) );
     LJ::statushistory_add(0, 0, 'sysban_mod', $msg);
 
     print "MODIFIED: banid=$banid\n";

Modified: trunk/bin/maint/synsuck.pl
===================================================================
--- trunk/bin/maint/synsuck.pl	2009-04-08 07:33:06 UTC (rev 15109)
+++ trunk/bin/maint/synsuck.pl	2009-04-08 07:35:22 UTC (rev 15110)
@@ -22,7 +22,7 @@
         # need to get some more rows
         my $dbh = LJ::get_db_writer();
         my $current_jobs = join(",", map { $dbh->quote($_->[0]) } values %child_jobs);
-        my $in_sql = " AND u.userid NOT IN ($current_jobs)" if $current_jobs;
+        my $in_sql = $current_jobs ? " AND u.userid NOT IN ($current_jobs)" : '';
         my $sth = $dbh->prepare("SELECT u.user, s.userid, s.synurl, s.lastmod, " .
                                 "       s.etag, s.numreaders, s.checknext " .
                                 "FROM user u, syndicated s " .

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