projects
/
c11tester.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
016ea07
)
model: use std::find for release sequence search
author
Brian Norris
<banorris@uci.edu>
Fri, 7 Sep 2012 17:31:08 +0000
(10:31 -0700)
committer
Brian Norris
<banorris@uci.edu>
Fri, 7 Sep 2012 17:44:42 +0000
(10:44 -0700)
model.cc
patch
|
blob
|
history
diff --git
a/model.cc
b/model.cc
index bebd130b89098d1966f67ed519b86e0043eb6e43..37bddaf96dcfc9b4a16b5b2dd426ad395ed65327 100644
(file)
--- a/
model.cc
+++ b/
model.cc
@@
-1,4
+1,5
@@
#include <stdio.h>
+#include <algorithm>
#include "model.h"
#include "action.h"
@@
-583,9
+584,8
@@
bool ModelChecker::release_seq_head(const ModelAction *rf,
action_list_t::const_reverse_iterator rit;
/* Find rf in the thread list */
- for (rit = list->rbegin(); rit != list->rend(); rit++)
- if (*rit == rf)
- break;
+ rit = std::find(list->rbegin(), list->rend(), rf);
+ ASSERT(rit != list->rend());
/* Find the last write/release */
for (; rit != list->rend(); rit++)