gravatar
kpeter (Peter Kovacs)
kpeter@inf.elte.hu
Critical bug fix in SmartDigraph::split() #170
0 1 0
default
1 file changed with 3 insertions and 1 deletions:
↑ Collapse diff ↑
Ignore white space 24 line context
... ...
@@ -296,25 +296,27 @@
296 296
    ///
297 297
    ///\note The <tt>Arc</tt>s
298 298
    ///referencing a moved arc remain
299 299
    ///valid. However <tt>InArc</tt>'s and <tt>OutArc</tt>'s
300 300
    ///may be invalidated.
301 301
    ///\warning This functionality cannot be used together with the Snapshot
302 302
    ///feature.
303 303
    Node split(Node n, bool connect = true)
304 304
    {
305 305
      Node b = addNode();
306 306
      nodes[b._id].first_out=nodes[n._id].first_out;
307 307
      nodes[n._id].first_out=-1;
308
      for(int i=nodes[b._id].first_out;i!=-1;i++) arcs[i].source=b._id;
308
      for(int i=nodes[b._id].first_out; i!=-1; i=arcs[i].next_out) {
309
        arcs[i].source=b._id;
310
      }
309 311
      if(connect) addArc(n,b);
310 312
      return b;
311 313
    }
312 314

	
313 315
  public:
314 316

	
315 317
    class Snapshot;
316 318

	
317 319
  protected:
318 320

	
319 321
    void restoreSnapshot(const Snapshot &s)
320 322
    {
0 comments (0 inline)