Skip to content

Commit

Permalink
Coding Standards: Remove unnecessary unset() calls in WP_Importer
Browse files Browse the repository at this point in the history
… methods.

Variables created within the scope of a function are discarded automatically when PHP leaves the scope of the function, i.e. on `return`, so doing a call to `unset()` straight before a `return` statement is redundant.

Props jrf, ravipatel, rachelbaker, mukesh27.
Fixes #52996.

git-svn-id: https://develop.svn.wordpress.org/trunk@50692 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Apr 8, 2021
1 parent ab3dbad commit 4e5569d
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions src/wp-admin/includes/class-wp-importer.php
Expand Up @@ -42,9 +42,6 @@ public function get_imported_posts( $importer_name, $blog_id ) {
}
} while ( count( $results ) == $limit );

// Unset to save memory.
unset( $results, $r );

return $hashtable;
}

Expand Down Expand Up @@ -72,9 +69,6 @@ public function count_imported_posts( $importer_name, $blog_id ) {
$count = (int) $result[0]->cnt;
}

// Unset to save memory.
unset( $results );

return $count;
}

Expand Down Expand Up @@ -117,9 +111,6 @@ public function get_imported_comments( $blog_id ) {
}
} while ( count( $results ) == $limit );

// Unset to save memory.
unset( $results, $r );

return $hashtable;
}

Expand Down

0 comments on commit 4e5569d

Please sign in to comment.