From 4e5569ddd398e22979800c85653588a5b5ed2a70 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 8 Apr 2021 11:10:16 +0000 Subject: [PATCH] Coding Standards: Remove unnecessary `unset()` calls in `WP_Importer` 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 --- src/wp-admin/includes/class-wp-importer.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/wp-admin/includes/class-wp-importer.php b/src/wp-admin/includes/class-wp-importer.php index a39fc60cd1..aaed2e9d81 100644 --- a/src/wp-admin/includes/class-wp-importer.php +++ b/src/wp-admin/includes/class-wp-importer.php @@ -42,9 +42,6 @@ class WP_Importer { } } while ( count( $results ) == $limit ); - // Unset to save memory. - unset( $results, $r ); - return $hashtable; } @@ -72,9 +69,6 @@ class WP_Importer { $count = (int) $result[0]->cnt; } - // Unset to save memory. - unset( $results ); - return $count; } @@ -117,9 +111,6 @@ class WP_Importer { } } while ( count( $results ) == $limit ); - // Unset to save memory. - unset( $results, $r ); - return $hashtable; }