From 50ff4dbba17c4dee3d7c3dd1e221e091b3a557db Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Mon, 9 Mar 2020 13:16:42 +0100 Subject: [PATCH] Remove unnecessary array initialization `$a[] = 1` will initialize the array, so the if block is not needed. --- core/project_hierarchy_api.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/core/project_hierarchy_api.php b/core/project_hierarchy_api.php index 1e2eb5e3e4..391492ff29 100644 --- a/core/project_hierarchy_api.php +++ b/core/project_hierarchy_api.php @@ -173,14 +173,7 @@ function project_hierarchy_cache( $p_show_disabled = false ) { $t_project_id = (int)$t_row['id']; $t_parent_id = ( null === $t_row['parent_id'] ) ? ALL_PROJECTS : (int)$t_row['parent_id']; - if( isset( $g_cache_project_hierarchy[$t_parent_id] ) ) { - $g_cache_project_hierarchy[$t_parent_id][] = $t_project_id; - } else { - $g_cache_project_hierarchy[$t_parent_id] = array( - $t_project_id, - ); - } - + $g_cache_project_hierarchy[$t_parent_id][] = $t_project_id; if( !isset( $g_cache_project_inheritance[$t_project_id] ) ) { $g_cache_project_inheritance[$t_project_id] = array();