From adccaa0225ce474d5d7a8e0833c11d0c0fdf944d Mon Sep 17 00:00:00 2001
From: Brian Norris <banorris@uci.edu>
Date: Fri, 7 Sep 2012 10:31:08 -0700
Subject: [PATCH] model: use std::find for release sequence search

---
 model.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/model.cc b/model.cc
index bebd130..37bddaf 100644
--- 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++)
-- 
2.34.1