summaryrefslogtreecommitdiffstats
path: root/src/libvpsc
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2013-10-26 12:33:17 +0000
committerJabiertxof <jtx@jtx.marker.es>2013-10-26 12:33:17 +0000
commit7caf32d2b22680c603e4e88c76739c758630412c (patch)
treedaaf4e77d712bd802076980d7a077dc6562f3df7 /src/libvpsc
parentRemoved BSpline from tell by su_v (diff)
parentFix memleak in reference counting introduced in r12532. (diff)
downloadinkscape-7caf32d2b22680c603e4e88c76739c758630412c.tar.gz
inkscape-7caf32d2b22680c603e4e88c76739c758630412c.zip
Update to trunk
(bzr r12588.1.24)
Diffstat (limited to 'src/libvpsc')
-rw-r--r--src/libvpsc/constraint.cpp4
-rw-r--r--src/libvpsc/solve_VPSC.cpp12
2 files changed, 8 insertions, 8 deletions
diff --git a/src/libvpsc/constraint.cpp b/src/libvpsc/constraint.cpp
index 2bd173155..0ec06dfac 100644
--- a/src/libvpsc/constraint.cpp
+++ b/src/libvpsc/constraint.cpp
@@ -24,11 +24,11 @@ Constraint::Constraint(Variable *left, Variable *right, double gap, bool equalit
}
Constraint::~Constraint() {
Constraints::iterator i;
- for(i=left->out.begin(); i!=left->out.end(); i++) {
+ for(i=left->out.begin(); i!=left->out.end(); ++i) {
if(*i==this) break;
}
left->out.erase(i);
- for(i=right->in.begin(); i!=right->in.end(); i++) {
+ for(i=right->in.begin(); i!=right->in.end(); ++i) {
if(*i==this) break;
}
right->in.erase(i);
diff --git a/src/libvpsc/solve_VPSC.cpp b/src/libvpsc/solve_VPSC.cpp
index f9bed649c..83cb517b6 100644
--- a/src/libvpsc/solve_VPSC.cpp
+++ b/src/libvpsc/solve_VPSC.cpp
@@ -301,16 +301,16 @@ bool Solver::constraintGraphIsCyclic(const unsigned n, Variable* const vs[]) {
varmap[vs[i]]->out.insert(varmap[r]);
}
}
- while(graph.size()>0) {
+ while(!graph.empty()) {
node *u=NULL;
vector<node*>::iterator i=graph.begin();
for(;i!=graph.end();++i) {
u=*i;
- if(u->in.size()==0) {
+ if(u->in.empty()) {
break;
}
}
- if(i==graph.end() && graph.size()>0) {
+ if(i==graph.end() && !graph.empty()) {
//cycle found!
return true;
} else {
@@ -358,16 +358,16 @@ bool Solver::blockGraphIsCyclic() {
c=b->findMinOutConstraint();
}
}
- while(graph.size()>0) {
+ while(!graph.empty()) {
node *u=NULL;
vector<node*>::iterator i=graph.begin();
for(;i!=graph.end();++i) {
u=*i;
- if(u->in.size()==0) {
+ if(u->in.empty()) {
break;
}
}
- if(i==graph.end() && graph.size()>0) {
+ if(i==graph.end() && !graph.empty()) {
//cycle found!
return true;
} else {