[TASK] Optimize invocation of cObj::checkIf 18/31418/2
authorOliver Hader <oliver@typo3.org>
Mon, 20 Jan 2014 15:52:37 +0000 (16:52 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Sun, 6 Jul 2014 21:24:05 +0000 (23:24 +0200)
commit73586569574ec03143d59cea2b5fa2515b757e09
tree5a61963092343dfff99f8df2c4a4dc0172996457
parent5b59fd454d4903b9b73784f89367ef7696f3d635
[TASK] Optimize invocation of cObj::checkIf

The stdWrap property "if" can be used to allow output only if a
defined criterion is met. However, the checkIf() method gets
called even if the property is not set in TypoScript.

Fix this by adding a quick empty() check to all calls.
Also optimizes the code structure to exit early in case the if
does not evaluate to TRUE.

Resolves: #55173
Releases: 6.3, 6.2
Change-Id: Ie1178a5df2e98fd19b848aa2300c901c1200f555
Reviewed-on: https://review.typo3.org/31418
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/frontend/Classes/ContentObject/CaseContentObject.php
typo3/sysext/frontend/Classes/ContentObject/ColumnsContentObject.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectArrayContentObject.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/ContentObject/HierarchicalMenuContentObject.php
typo3/sysext/frontend/Classes/ContentObject/ImageContentObject.php
typo3/sysext/frontend/Classes/ContentObject/Menu/ImageMenuContentObject.php