diff --git a/src/query.c b/src/query.c index bb4de308c..984a5132b 100644 --- a/src/query.c +++ b/src/query.c @@ -1839,38 +1839,27 @@ void query_destroy(query *q) free(q); } -void query_reset(query *q) -{ - q->flags.occurs_check = false; - q->get_started = get_time_in_usec(); - q->time_cpu_last_started = q->time_cpu_started = cpu_time_in_usec(); - q->ops_dirty = true; - q->double_quotes = false; - q->st.prob = 1.0; - q->max_depth = 0; - q->halt = false; - q->error = false; - q->st.hp = 0; - q->st.tp = 0; - q->st.sp = 0; - mp_int_init(&q->tmp_ival); - mp_rat_init(&q->tmp_irat); - clr_accum(&q->accum); -} - query *query_create(module *m, bool is_task) { static atomic_t uint64_t g_query_id = 0; query *q = calloc(1, sizeof(query)); ensure(q); + q->flags.occurs_check = false; q->qid = g_query_id++; q->pl = m->pl; q->st.prev_m = q->st.m = m; q->trace = m->pl->trace; q->flags = m->flags; - - query_reset(q); + q->get_started = get_time_in_usec(); + q->time_cpu_last_started = q->time_cpu_started = cpu_time_in_usec(); + q->ops_dirty = true; + q->double_quotes = false; + q->st.prob = 1.0; + q->max_depth = 0; + mp_int_init(&q->tmp_ival); + mp_rat_init(&q->tmp_irat); + clr_accum(&q->accum); // Allocate these now... diff --git a/src/query.h b/src/query.h index 4d50a3371..b303283f2 100644 --- a/src/query.h +++ b/src/query.h @@ -12,7 +12,6 @@ typedef struct { query *query_create(module *m, bool sub_query); query *query_create_task(query *q, cell *curr_cell); -void query_reset(query *q); void query_destroy(query *q); bool push_choice(query *q);