Fixed Code Redudency (Warning Members)

Daniel Hood

Well-known member
I was just looking at XenForo_ControllerPublic_Member::actionWarn() and noticed some redudency;

At line 788, the warnings get prepared.
PHP:
$warnings = $warningModel->prepareWarningDefinitions($warningModel->getWarningDefinitions());

At line 800, the warning selected gets prepared again:
PHP:
$warning = $warningModel->prepareWarningDefinition($warnings[$dwInput['warning_definition_id']]);

Unless I'm missing something, just using $warning[$dwInput['warning_definition_id']] would produce the same result.
 
Back
Top Bottom