From 261dbf935562b373816022f39765400c46c71b03 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Thu, 12 Jul 2012 15:38:10 -0700 Subject: [PATCH] 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. --- model.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- 2.34.1