View Single Post
Author Message
JocAnis
Veteran Member
Join Date: Jun 2010
Old 10-08-2019 , 09:49   Avoid duplicating the code
Reply With Quote #1

hi guys..im interested in 'small' improvement in coding, lets say i have:

Code:
if( get_pcvar_num( cvar1 ) )
{
	if( blablabla )
	{
		//do some 20 lines here
	}
}
else
{
	if( tuctuctuc )
	{
		//do some 20 lines here (same lines as above)
	}
}
i would like to look like this (like hierarchy):
Code:
if( get_pcvar_num( cvar1 ) )
{
	if( blablabla )
}
else
{
	if( tuctuctuc )
}
//do some 20 lines here
but how i undestand, if clausules cant be put like this :/
__________________
KZ Public Autocup - PrimeKZ

My blog: http://primekz.xyz (in progress...) - not active (dec 2022)

Last edited by JocAnis; 10-08-2019 at 10:07.
JocAnis is offline