From 2402e5837208604d0926053cde5db51ac0f0853f Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Thu, 12 Jul 2012 11:04:58 -0700 Subject: [PATCH] model: factor out 'tid' calculation --- model.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/model.cc b/model.cc index 41e4421..e579105 100644 --- a/model.cc +++ b/model.cc @@ -283,14 +283,15 @@ void ModelChecker::check_current_action(void) */ void ModelChecker::add_action_to_lists(ModelAction *act) { + int tid = id_to_int(act->get_tid()); action_trace->push_back(act); std::vector *vec = &(*obj_thrd_map)[act->get_location()]; - if (id_to_int(act->get_tid()) >= (int)vec->size()) + if (tid >= (int)vec->size()) vec->resize(next_thread_id); - (*vec)[id_to_int(act->get_tid())].push_back(act); + (*vec)[tid].push_back(act); - (*thrd_last_action)[id_to_int(act->get_tid())] = act; + (*thrd_last_action)[tid] = act; } ModelAction * ModelChecker::get_last_action(thread_id_t tid) -- 2.34.1