projects
/
model-checker.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
80bd54a
)
cyclegraph: use vector empty() and clear()
author
Brian Norris
<banorris@uci.edu>
Wed, 30 Jan 2013 18:19:21 +0000
(10:19 -0800)
committer
Brian Norris
<banorris@uci.edu>
Thu, 31 Jan 2013 03:04:55 +0000
(19:04 -0800)
cyclegraph.cc
patch
|
blob
|
history
diff --git
a/cyclegraph.cc
b/cyclegraph.cc
index 7632b0c9c591e44d3e1e42322ab44808142fd195..00b8cd85731800fcdfb3593147d2bbd5bd84ace4 100644
(file)
--- a/
cyclegraph.cc
+++ b/
cyclegraph.cc
@@
-240,33
+240,31
@@
bool CycleGraph::checkPromise(const ModelAction *fromact, Promise *promise) cons
void CycleGraph::startChanges()
{
void CycleGraph::startChanges()
{
- ASSERT(rollbackvector.
size() == 0
);
- ASSERT(rmwrollbackvector.
size() == 0
);
+ ASSERT(rollbackvector.
empty()
);
+ ASSERT(rmwrollbackvector.
empty()
);
ASSERT(oldCycles == hasCycles);
}
/** Commit changes to the cyclegraph. */
void CycleGraph::commitChanges()
{
ASSERT(oldCycles == hasCycles);
}
/** Commit changes to the cyclegraph. */
void CycleGraph::commitChanges()
{
- rollbackvector.
resize(0
);
- rmwrollbackvector.
resize(0
);
+ rollbackvector.
clear(
);
+ rmwrollbackvector.
clear(
);
oldCycles = hasCycles;
}
/** Rollback changes to the previous commit. */
void CycleGraph::rollbackChanges()
{
oldCycles = hasCycles;
}
/** Rollback changes to the previous commit. */
void CycleGraph::rollbackChanges()
{
- for (unsigned int i = 0; i < rollbackvector.size(); i++)
{
+ for (unsigned int i = 0; i < rollbackvector.size(); i++)
rollbackvector[i]->popEdge();
rollbackvector[i]->popEdge();
- }
- for (unsigned int i = 0; i < rmwrollbackvector.size(); i++)
{
+ for (unsigned int i = 0; i < rmwrollbackvector.size(); i++)
rmwrollbackvector[i]->clearRMW();
rmwrollbackvector[i]->clearRMW();
- }
hasCycles = oldCycles;
hasCycles = oldCycles;
- rollbackvector.
resize(0
);
- rmwrollbackvector.
resize(0
);
+ rollbackvector.
clear(
);
+ rmwrollbackvector.
clear(
);
}
/** @returns whether a CycleGraph contains cycles. */
}
/** @returns whether a CycleGraph contains cycles. */