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 {
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 {