return res;
}
-/* returns 1 if row admissible, 0 if not, negative on errors */
-static int row_is_admissible(const struct osl_row *aft_row, struct mood *m)
-{
- assert(m);
- return mp_eval_row(aft_row, m->parser_context);
-}
-
static void destroy_mood(struct mood *m)
{
if (!m)
static int add_if_admissible(struct osl_row *aft_row, void *data)
{
struct admissible_array *aa = data;
- int ret;
- ret = row_is_admissible(aft_row, aa->m);
- if (ret <= 0)
- return ret;
+ if (!mp_eval_row(aft_row, aa->m->parser_context))
+ return 0;
if (statistics.num >= aa->size) {
aa->size *= 2;
aa->size += 100;
if (ret < 0)
return ret;
was_admissible = ret;
- ret = row_is_admissible(aft_row, current_mood);
- if (ret < 0)
- return ret;
- is_admissible = (ret > 0);
+ is_admissible = mp_eval_row(aft_row, current_mood->parser_context);
if (!was_admissible && !is_admissible)
return 1;
if (was_admissible && !is_admissible)