usage of local variables when array is contructed in relation to external condition