﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc
13662	Admin Menu Generation - Speedup, Cleanup	dragoonis	duck_	"'''Speed improvements to _wp_menu_output()'''
[[BR]][[BR]]

'''Speedup'''
[[BR]][[BR]]
More ternaries vs basic if/else statements.[[BR]][[BR]]
Assignment to reduce multi dimension references:
{{{
$submenu_items = $submenu[$item[2]];
}}}
So we don't have to do index lookups like
{{{
$submenu[$item[2]][0][2]
}}}

Speedup such as:[[BR]]
{{{
if(file_exists() || empty())
}}}
to:
{{{
if(empty() || file_exists())
}}}
[[BR]]
'''Readability'''
{{{
if ( false !== $pos = strpos($menu_file, '?') )
}}}
to:
{{{
if ( false !== ($pos = strpos($menu_file, '?')) )
}}}
[[BR]]
'''Speedup, Readability and Maintainability'''
[[BR]]
from: One big 1-liner if statement[[BR]]
to:[[BR]]
(I have moved the main '''OR''' branch to now have the small condition first, whereas it was last before.)[[BR]]
(I have restructured the IF to become readable and some usage of '''===''')
{{{
} else if ( 
    (!isset($plugin_page) && $self == $sub_item[2]) ||                
    (isset($plugin_page) 
        && $plugin_page == $sub_item[2] 
        && (($item[2] == $self_type) || ($item[2] == $self) || file_exists($menu_file) === false)
)) {
}}}"	enhancement	closed	normal	3.3	Optimization	3.0	normal	fixed	has-patch	
