Permalink
Browse files

[Form] minor code simplification

  • Loading branch information...
1 parent f3cafcb commit c9acf2e60c8b108b3f0a950fcceb025c6c40bf1d @eriksencosta eriksencosta committed Jun 9, 2011
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/Symfony/Component/Form/FormView.php
@@ -110,21 +110,23 @@ public function setAttribute($name, $value)
*/
public function isRendered()
{
- if (true === $this->rendered || 0 == count($this->children)) {
+ $hasChildren = 0 < count($this->children);
+
+ if (true === $this->rendered || !$hasChildren) {
return $this->rendered;
}
- if (count($this->children) > 0) {
+ if ($hasChildren) {
foreach ($this->children as $child) {
if (!$child->isRendered()) {
return false;
}
}
return $this->rendered = true;
- } else {
- return false;
}
+
+ return false;
}
/**

0 comments on commit c9acf2e

Please sign in to comment.