Set dists in a bit better way.
authoralpar
Tue, 30 Aug 2005 20:50:58 +0000
changeset 166630d7e673781f
parent 1665 fdeb961110ac
child 1667 73c7bd1227fe
Set dists in a bit better way.
lemon/dfs.h
     1.1 --- a/lemon/dfs.h	Tue Aug 30 14:55:11 2005 +0000
     1.2 +++ b/lemon/dfs.h	Tue Aug 30 20:50:58 2005 +0000
     1.3 @@ -512,9 +512,14 @@
     1.4  	  _pred->set(s,INVALID);
     1.5  	  // _predNode->set(u,INVALID);
     1.6  	  OutEdgeIt e(*G,s);
     1.7 -	  if(e!=INVALID) _stack[++_stack_head]=e;
     1.8 -	  else _processed->set(s,true);
     1.9 -	  _dist->set(s,_stack_head);
    1.10 +	  if(e!=INVALID) {
    1.11 +	    _stack[++_stack_head]=e;
    1.12 +	    _dist->set(s,_stack_head);
    1.13 +	  }
    1.14 +	  else {
    1.15 +	    _processed->set(s,true);
    1.16 +	    _dist->set(s,0);
    1.17 +	  }
    1.18  	}
    1.19      }
    1.20