# HG changeset patch
# User Balazs Dezso <deba@inf.elte.hu>
# Date 1216833680 -7200
# Node ID e39056157d24b92148602b884de400f1ce6579c1
# Parent  9ce7a01a95c7e5faa01c80e6697dad0e2d863291
Two bug fixes in DynArcLookUp

diff -r 9ce7a01a95c7 -r e39056157d24 lemon/core.h
--- a/lemon/core.h	Wed Jul 23 16:51:07 2008 +0100
+++ b/lemon/core.h	Wed Jul 23 19:21:20 2008 +0200
@@ -1384,6 +1384,7 @@
         } else {
           _right.set(e, _right[arc]);
           _parent.set(_right[arc], e);
+          _parent.set(e, _parent[arc]);
 
           if (_parent[arc] != INVALID) {
             if (_left[_parent[arc]] == arc) {
@@ -1514,6 +1515,7 @@
     Arc operator()(Node s, Node t) const
     {
       Arc a = _head[s];
+      if (a == INVALID) return INVALID;
       while (true) {
         if (_g.target(a) == t) {
           const_cast<DynArcLookUp&>(*this).splay(a);
@@ -1548,6 +1550,7 @@
     Arc findFirst(Node s, Node t) const
     {
       Arc a = _head[s];
+      if (a == INVALID) return INVALID;
       Arc r = INVALID;
       while (true) {
         if (_g.target(a) < t) {