summaryrefslogtreecommitdiff
path: root/src/theory/arrays
diff options
context:
space:
mode:
authorPiotr Trojanek <piotr.trojanek@gmail.com>2019-08-22 23:22:51 +0200
committerAndres Noetzli <andres.noetzli@gmail.com>2019-10-08 11:03:44 -0700
commite7929d2cd241d8b4974d26b9e11f1378ba30b0e7 (patch)
tree397a57a6769ee3e3d7a6ea6a646676b35f6c64bb /src/theory/arrays
parent788212a3783affa634dc685b6f1b086f292c2528 (diff)
prefer prefix ++ operator for iterators
Detected with cppcheck static analyser, which said: (performance) Prefer prefix ++/-- operators for non-primitive types. Reformat with clang-format as needed. Signed-off-by: Piotr Trojanek <piotr.trojanek@gmail.com>
Diffstat (limited to 'src/theory/arrays')
-rw-r--r--src/theory/arrays/array_info.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/theory/arrays/array_info.cpp b/src/theory/arrays/array_info.cpp
index e92947c7f..0d1095a23 100644
--- a/src/theory/arrays/array_info.cpp
+++ b/src/theory/arrays/array_info.cpp
@@ -68,7 +68,8 @@ ArrayInfo::ArrayInfo(context::Context* c, Backtracker<TNode>* b, std::string sta
ArrayInfo::~ArrayInfo() {
CNodeInfoMap::iterator it = info_map.begin();
- for( ; it != info_map.end(); it++ ) {
+ for (; it != info_map.end(); ++it)
+ {
if((*it).second!= emptyInfo) {
delete (*it).second;
}
@@ -87,7 +88,8 @@ ArrayInfo::~ArrayInfo() {
bool inList(const CTNodeList* l, const TNode el) {
CTNodeList::const_iterator it = l->begin();
- for ( ; it!= l->end(); it ++) {
+ for (; it != l->end(); ++it)
+ {
if(*it == el)
return true;
}
@@ -97,7 +99,8 @@ bool inList(const CTNodeList* l, const TNode el) {
void printList (CTNodeList* list) {
CTNodeList::const_iterator it = list->begin();
Trace("arrays-info")<<" [ ";
- for(; it != list->end(); it++ ) {
+ for (; it != list->end(); ++it)
+ {
Trace("arrays-info")<<(*it)<<" ";
}
Trace("arrays-info")<<"] \n";
@@ -106,7 +109,8 @@ void printList (CTNodeList* list) {
void printList (List<TNode>* list) {
List<TNode>::const_iterator it = list->begin();
Trace("arrays-info")<<" [ ";
- for(; it != list->end(); it++ ) {
+ for (; it != list->end(); ++it)
+ {
Trace("arrays-info")<<(*it)<<" ";
}
Trace("arrays-info")<<"] \n";
@@ -115,11 +119,13 @@ void printList (List<TNode>* list) {
void ArrayInfo::mergeLists(CTNodeList* la, const CTNodeList* lb) const{
std::set<TNode> temp;
CTNodeList::const_iterator it;
- for(it = la->begin() ; it != la->end(); it++ ) {
+ for (it = la->begin(); it != la->end(); ++it)
+ {
temp.insert((*it));
}
- for(it = lb->begin() ; it!= lb->end(); it++ ) {
+ for (it = lb->begin(); it != lb->end(); ++it)
+ {
if(temp.count(*it) == 0) {
la->push_back(*it);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback