1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Minor clean-ups.

This commit is contained in:
jules 2012-12-31 19:10:54 +00:00
parent 5f8069719e
commit 7a3453f48b
32 changed files with 219 additions and 277 deletions

View file

@ -52,12 +52,8 @@ namespace ComponentBuilderHelpers
return &c;
for (int i = c.getNumChildComponents(); --i >= 0;)
{
Component* const child = findComponentWithID (*c.getChildComponent (i), compId);
if (child != nullptr)
if (Component* const child = findComponentWithID (*c.getChildComponent (i), compId))
return child;
}
return nullptr;
}
@ -73,9 +69,7 @@ namespace ComponentBuilderHelpers
static void updateComponent (ComponentBuilder& builder, const ValueTree& state)
{
Component* topLevelComp = builder.getManagedComponent();
if (topLevelComp != nullptr)
if (Component* topLevelComp = builder.getManagedComponent())
{
ComponentBuilder::TypeHandler* const type = builder.getHandlerForState (state);
const String uid (getStateId (state));
@ -88,9 +82,7 @@ namespace ComponentBuilderHelpers
}
else
{
Component* const changedComp = findComponentWithID (*topLevelComp, uid);
if (changedComp != nullptr)
if (Component* const changedComp = findComponentWithID (*topLevelComp, uid))
type->updateComponentFromState (changedComp, state);
}
}
@ -264,11 +256,10 @@ void ComponentBuilder::updateChildComponents (Component& parent, const ValueTree
if (c == nullptr)
{
TypeHandler* const type = getHandlerForState (childState);
jassert (type != nullptr);
if (type != nullptr)
if (TypeHandler* const type = getHandlerForState (childState))
c = ComponentBuilderHelpers::createNewComponent (*type, childState, &parent);
else
jassertfalse;
}
if (c != nullptr)