bug 206: allow comparing addresses of different types.
authorMathieu Lacage <mathieu.lacage@sophia.inria.fr>
Wed Jun 04 10:09:29 2008 -0700 (20 months ago)
changeset 3215c5a74196e87a
parent 3214 5c73d8f952bf
child 3216 b36bb98d766e
bug 206: allow comparing addresses of different types.
src/node/address.cc
     1.1 --- a/src/node/address.cc	Wed Jun 04 09:22:37 2008 -0700
     1.2 +++ b/src/node/address.cc	Wed Jun 04 10:09:29 2008 -0700
     1.3 @@ -162,8 +162,14 @@
     1.4  }
     1.5  bool operator < (const Address &a, const Address &b)
     1.6  {
     1.7 -  // XXX: it is not clear to me how to order based on type.
     1.8 -  // so, we do not compare the types here but we should.
     1.9 +  if (a.m_type < b.m_type)
    1.10 +    {
    1.11 +      return true;
    1.12 +    }
    1.13 +  else if (a.m_type > b.m_type)
    1.14 +    {
    1.15 +      return false;
    1.16 +    }
    1.17    if (a.m_len < b.m_len)
    1.18      {
    1.19        return true;