optimized function _parse_condition