X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/mediawiki.git/blobdiff_plain/87219ebd28426c6d21cb545233ee52f5f7af7dfd..refs/tags/mediawiki-1.17.0:/includes/WatchedItem.php diff --git a/includes/WatchedItem.php b/includes/WatchedItem.php index d1c15296..dd6e247b 100644 --- a/includes/WatchedItem.php +++ b/includes/WatchedItem.php @@ -84,6 +84,8 @@ class WatchedItem { * @return bool */ public function removeWatch() { + wfProfileIn( __METHOD__ ); + $success = false; $dbw = wfGetDB( DB_MASTER ); $dbw->delete( 'watchlist', @@ -112,6 +114,8 @@ class WatchedItem { if ( $dbw->affectedRows() ) { $success = true; } + + wfProfileOut( __METHOD__ ); return $success; } @@ -143,14 +147,13 @@ class WatchedItem { ); # Construct array to replace into the watchlist $values = array(); - while ( $s = $dbw->fetchObject( $res ) ) { + foreach ( $res as $s ) { $values[] = array( 'wl_user' => $s->wl_user, 'wl_namespace' => $newnamespace, 'wl_title' => $newtitle ); } - $dbw->freeResult( $res ); if( empty( $values ) ) { // Nothing to do