Reduce the size of the data returned by get_themes() by ~30% by reducing duplication.

git-svn-id: http://svn.automattic.com/wordpress/trunk@12226 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2009-11-19 20:45:37 +00:00
parent 9a1a22076f
commit c616c60c0d
1 changed files with 4 additions and 1 deletions

View File

@ -365,6 +365,10 @@ function get_themes() {
@ $template_dir->close();
}
//Make unique and remove duplicates when stylesheet and template are the same i.e. most themes
$template_files = array_unique($template_files);
$stylesheet_files = array_unique($stylesheet_files);
$template_dir = dirname($template_files[0]);
$stylesheet_dir = dirname($stylesheet_files[0]);
@ -595,7 +599,6 @@ function search_theme_directories() {
if ( is_dir( $theme_dir ) )
@closedir( $theme_dir );
}
return $theme_files;
}