Avoid push_back Edit on GitHub
Avoid doing this:
There are a few reasons why:
- There are good reasons to avoid mutable local variables in general.
nilchildren are automatically dropped by
CKStackLayoutComponent, so there’s no need to check for
nilbefore adding to the list of children.
- Conditionals are best done inline; or, encapsulate the checks in a new
CKCompositeComponentthat renders to
nilif the conditional fails.
Instead, do this: