cwPresetSel.cpp : Rewrote _validate_preset_id() to clarify logic.

This commit is contained in:
kevin 2024-03-25 10:56:32 -04:00
parent b354b29581
commit 70b147007e

View File

@ -405,10 +405,12 @@ namespace cw
rc_t _validate_preset_id( const frag_t* frag, unsigned preset_id )
{
bool fl = (preset_id < frag->presetN) && (frag->presetA[ preset_id ].preset_idx == preset_id);
rc_t rc = kOkRC;
return fl ? kOkRC : cwLogError(kInvalidIdRC,"The preset id '%i' is invalid on the fragment at loc:%i.",preset_id,frag->endLoc);
if( (preset_id >= frag->presetN) || (frag->presetA[ preset_id ].preset_idx != preset_id) )
rc = cwLogError(kInvalidIdRC,"The preset id '%i' is invalid on the fragment at loc:%i.",preset_id,frag->endLoc);
return rc;
}
bool _is_master_var_id( unsigned varId )