HTCPPurge() early exit on socket error
authorAntoine Musso <hashar@free.fr>
Tue, 2 Jul 2013 10:42:39 +0000 (12:42 +0200)
committerHashar <hashar@free.fr>
Tue, 16 Jul 2013 14:41:27 +0000 (14:41 +0000)
commit9cf0a3d81ffd77202450731f6b1d38e2fe129022
tree5b330979cf95f5b4fc2dc94182b519a841c27b3b
parent3608ba2a349be4403ce973abf86cd9c230c62949
HTCPPurge() early exit on socket error

I tend to dislike code style such as:

if( $ok ) {
// lot of code
} else {
return false;
}

The SquidUpdate::HTCPPurge() used that pattern to handle a
socket_create() issue.  I have simply moved the block above and inverted
the condition.  Ie:

if( ! $ok ) {
return false;
}
// lot of code

That saves a level of indentation and makes the code a bit easier to
follow IMHO.

Change-Id: Ic3c6e22bbb637352fef740a0c1663a4b6f5a2b6a
includes/cache/SquidUpdate.php