]> granicus.if.org Git - graphviz/commitdiff
remove useless code
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 3 Apr 2021 01:56:33 +0000 (18:56 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 10 Apr 2021 21:53:50 +0000 (14:53 -0700)
This was added in the initial commit of VPSC,
03c20a55c921ac07599be2ae19ae34209ec0d02e. The comment was incorrect. This does
*not* limit iteration because the variable type is unsigned. That is, it is
always >= 0. This was caught by enabling CXXFLAGS+=-Wtype-limits.

lib/vpsc/solve_VPSC.cpp

index cb1328ef7eeb15dfde8633291177bcc5bf9aca1e..bc10c9b5347eb04fd5ec5afc2d1c33c8bf3711ea 100644 (file)
@@ -100,12 +100,8 @@ void VPSC::satisfy() {
 
 void VPSC::refine() {
        bool solved=false;
-       // Solve shouldn't loop indefinitely
-       // ... but just to make sure we limit the number of iterations
-       unsigned maxtries=100;
-       while(!solved&&maxtries>=0) {
+       while(!solved) {
                solved=true;
-               maxtries--;
                for(set<Block*>::const_iterator i=bs->begin();i!=bs->end();i++) {
                        Block *b=*i;
                        b->setUpInConstraints();