Make WordPress Core

Changeset 50692


Ignore:
Timestamp:
04/08/2021 11:10:16 AM (4 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-importer.php

    r50658 r50692  
    4343        } while ( count( $results ) == $limit );
    4444
    45         // Unset to save memory.
    46         unset( $results, $r );
    47 
    4845        return $hashtable;
    4946    }
     
    7269            $count = (int) $result[0]->cnt;
    7370        }
    74 
    75         // Unset to save memory.
    76         unset( $results );
    7771
    7872        return $count;
     
    117111            }
    118112        } while ( count( $results ) == $limit );
    119 
    120         // Unset to save memory.
    121         unset( $results, $r );
    122113
    123114        return $hashtable;
Note: See TracChangeset for help on using the changeset viewer.