From: Brian Norris Date: Thu, 12 Jul 2012 22:38:10 +0000 (-0700) Subject: model: improve ModelChecker::get_last_conflict() search X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=261dbf935562b373816022f39765400c46c71b03;p=cdsspec-compiler.git model: improve ModelChecker::get_last_conflict() search Use the recently-added 'obj_map' to isolate a list of actions on only the current object (memory location). That way, we don't have to iterate through as much noise in our lists. --- diff --git a/model.cc b/model.cc index 85e1f84..aef7cb9 100644 --- a/model.cc +++ b/model.cc @@ -177,8 +177,9 @@ ModelAction * ModelChecker::get_last_conflict(ModelAction *act) return NULL; } /* linear search: from most recent to oldest */ + action_list_t *list = &(*obj_map)[act->get_location()]; action_list_t::reverse_iterator rit; - for (rit = action_trace->rbegin(); rit != action_trace->rend(); rit++) { + for (rit = list->rbegin(); rit != list->rend(); rit++) { ModelAction *prev = *rit; if (act->is_synchronizing(prev)) return prev;