Optimizing the function bz_optionIndex()