gravatar
alpar (Alpar Juttner)
alpar@cs.elte.hu
Merge bugfix #366 to branch 1.0
0 1 0
merge 1.0
0 files changed with 2 insertions and 2 deletions:
↑ Collapse diff ↑
Show white space 24 line context
... ...
@@ -37,25 +37,25 @@
37 37
    int length() const {
38 38
      int len = 0;
39 39
      typename Digraph::Node node = target;
40 40
      typename Digraph::Arc arc;
41 41
      while ((arc = predMap[node]) != INVALID) {
42 42
        node = digraph.source(arc);
43 43
        ++len;
44 44
      }
45 45
      return len;
46 46
    }
47 47

	
48 48
    bool empty() const {
49
      return predMap[target] != INVALID;
49
      return predMap[target] == INVALID;
50 50
    }
51 51

	
52 52
    class RevArcIt {
53 53
    public:
54 54
      RevArcIt() {}
55 55
      RevArcIt(Invalid) : path(0), current(INVALID) {}
56 56
      RevArcIt(const PredMapPath& _path)
57 57
        : path(&_path), current(_path.target) {
58 58
        if (path->predMap[current] == INVALID) current = INVALID;
59 59
      }
60 60

	
61 61
      operator const typename Digraph::Arc() const {
... ...
@@ -111,25 +111,25 @@
111 111
    int length() const {
112 112
      int len = 0;
113 113
      typename Digraph::Node node = target;
114 114
      typename Digraph::Arc arc;
115 115
      while ((arc = predMatrixMap(source, node)) != INVALID) {
116 116
        node = digraph.source(arc);
117 117
        ++len;
118 118
      }
119 119
      return len;
120 120
    }
121 121

	
122 122
    bool empty() const {
123
      return source != target;
123
      return predMatrixMap(source, target) == INVALID;
124 124
    }
125 125

	
126 126
    class RevArcIt {
127 127
    public:
128 128
      RevArcIt() {}
129 129
      RevArcIt(Invalid) : path(0), current(INVALID) {}
130 130
      RevArcIt(const PredMatrixMapPath& _path)
131 131
        : path(&_path), current(_path.target) {
132 132
        if (path->predMatrixMap(path->source, current) == INVALID)
133 133
          current = INVALID;
134 134
      }
135 135

	
0 comments (0 inline)