diff options
Diffstat (limited to 'TAO/tao/ObjectKey_Table.cpp')
-rw-r--r-- | TAO/tao/ObjectKey_Table.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/TAO/tao/ObjectKey_Table.cpp b/TAO/tao/ObjectKey_Table.cpp index 38a851353de..e3e52089e4a 100644 --- a/TAO/tao/ObjectKey_Table.cpp +++ b/TAO/tao/ObjectKey_Table.cpp @@ -11,26 +11,32 @@ ACE_RCSID(tao, TAO_BEGIN_VERSIONED_NAMESPACE_DECL -bool +int TAO::Less_Than_ObjectKey::operator () (const TAO::ObjectKey &lhs, const TAO::ObjectKey &rhs) const { - const CORBA::ULong rlen = rhs.length (); - const CORBA::ULong llen = lhs.length (); - if (llen < rlen) + if (lhs.length () < rhs.length ()) { return 1; } - else if (llen > rlen) + else if (lhs.length () > rhs.length ()) { return 0; } - const CORBA::Octet * rhs_buff = rhs.get_buffer (); - const CORBA::Octet * lhs_buff = lhs.get_buffer (); - const bool result = (ACE_OS::memcmp (lhs_buff, rhs_buff, rlen) < 0); + for (CORBA::ULong i = 0; i < rhs.length (); ++i) + { + if (lhs[i] < rhs[i]) + { + return 1; + } + else if (lhs[i] > rhs[i]) + { + return 0; + } + } - return result; + return 0; } /********************************************************/ @@ -86,7 +92,7 @@ TAO::ObjectKey_Table::bind (const TAO::ObjectKey &key, key_new); } - (void) key_new->incr_refcount (); + key_new->incr_refcount (); } return retval; |