summaryrefslogtreecommitdiff
path: root/includes/WatchedItem.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/WatchedItem.php')
-rw-r--r--includes/WatchedItem.php7
1 files changed, 5 insertions, 2 deletions
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