#22828 closed enhancement (fixed)
Remove Duplicate Array Check
| Reported by: | miqrogroove | Owned by: | wonderboymusic |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.7 |
| Component: | Performance | Version: | 3.4.2 |
| Severity: | normal | Keywords: | has-patch 3.6-early |
| Cc: | Focuses: |
Description
I just stumbled across this silly bit of code in function get_core_updates()
if ( !isset( $from_api->updates ) || !is_array( $from_api->updates ) ) return false; $updates = $from_api->updates; if ( !is_array( $updates ) ) return false;
Attachments (4)
Change History (11)
Note:
See TracTickets
for help on using tickets.
Explanation of miqro-22828.2.diff :
An additional operation is saved because if isset( $from_api->updates ) then the function should proceed normally and this implies !empty($from_api). On the other hand, if !isset( $from_api->updates ) then the function should return to the caller and there is no reason to check if ( empty($from_api) ).