Cleanup: instead of
func
{
if( x )
{
three pages of code
}
}
do
func
{
if( !x )
return;
three pages of code;
}
which reduces the indentation level and is easier to understand.
This commit is contained in:
@@ -572,12 +572,14 @@ void ScreenPackages::EnterURL( const CString & sURL )
|
||||
}
|
||||
void ScreenPackages::HTTPUpdate()
|
||||
{
|
||||
if ( m_bIsDownloading )
|
||||
{
|
||||
if( !m_bIsDownloading )
|
||||
return;
|
||||
|
||||
int BytesGot=0;
|
||||
//Keep this as a code block
|
||||
//as there may be need to "if" it out some time.
|
||||
{
|
||||
/* If you need a conditional for a large block of code, stick it in
|
||||
* a function and return. */
|
||||
int Size = 1;
|
||||
while ( Size > 0 )
|
||||
{
|
||||
@@ -663,8 +665,6 @@ void ScreenPackages::HTTPUpdate()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool ScreenPackages::ParseHTTPAddress( const CString & URL, CString & Proto, CString & Server, int & Port, CString & Addy )
|
||||
|
||||
Reference in New Issue
Block a user