[TYPO3-core] RFC #16586: Refactor conditions in t3lib_extFileFunc

Andreas Wolf typo3ml at andreaswolf.info
Tue Nov 30 13:41:42 CET 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jigal

Am 28.11.10 12:26, schrieb Jigal van Hemert:
> Hi,
> 
> On 28-11-2010 1:29, Andreas Wolf wrote:
>> before:
>> if (condition) {
>>    foo();
>>    bar();
>> } else {
>>    $this->writeLog(...);
>> }
>>
>> after:
>> if (!condition) {
>>    $this->writeLog(...);
>> }
>> foo();
>> bar();
> 
> before and after are not functionally identical. after would be
> functionally identical to:
> if (condition) {
>     foo();
>     bar();
> } else {
>     $this->writeLog(...);
>     foo();
>     bar();
> }
> 
> writeLog simply returns after logging the message, so execution continues.

Argh. Yes. The example is wrong. It should have been:

after:
if (!condition) {
   $this->writeLog(...);
   return FALSE;
}
foo();
bar();

I just realized that not all places in my patch contained the return
statement. I added it everywhere in v2.

Regards
Andreas
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkz08QYACgkQHWtXp155bP8pDQCeLhC7UMxjcg8TXNfft3rA2l1F
elwAn2yOocGUTYYgjBWt992/k9WO5jOn
=rl3d
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0016586_v2.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101130/0b20e7cd/attachment.asc>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0016586_v2.diff.sig
Type: application/octet-stream
Size: 72 bytes
Desc: not available
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20101130/0b20e7cd/attachment-0001.obj>


More information about the TYPO3-team-core mailing list