Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perf: Any call operation id() only for supported types #903 #1046

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 36 additions & 14 deletions TAO/tao/AnyTypeCode/TypeCode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,22 +91,44 @@ CORBA::TypeCode::equivalent (TypeCode_ptr tc) const
if (tc_kind != this_kind)
return false;

try
switch (this_kind)
{
char const * const this_id = unaliased_this->id ();
char const * const tc_id = unaliased_tc->id ();

if (ACE_OS::strlen (this_id) != 0
&& ACE_OS::strlen (tc_id) != 0)
{
return ACE_OS::strcmp (this_id, tc_id) == 0;
}
}
catch (const ::CORBA::TypeCode::BadKind&)
case tk_objref:
case tk_struct:
case tk_union:
case tk_enum:
case tk_alias:
case tk_value:
case tk_value_box:
case tk_native:
case tk_abstract_interface:
case tk_local_interface:
case tk_except:
case tk_component:
case tk_home:
case tk_event:
{
// Some TypeCodes do not support the id() operation. Ignore the
// failure, and continue equivalence verification using TypeCode
// subclass-specific techniques.
try
{
char const * const this_id = unaliased_this->id ();
char const * const tc_id = unaliased_tc->id ();

if (ACE_OS::strlen (this_id) != 0
&& ACE_OS::strlen (tc_id) != 0)
{
return ACE_OS::strcmp (this_id, tc_id) == 0;
}
}
catch (const ::CORBA::TypeCode::BadKind&)
{
// Some TypeCodes do not support the id() operation. Ignore the
// failure, and continue equivalence verification using TypeCode
// subclass-specific techniques.
}
break;
}
default:
; // Do nothing
}

return unaliased_this->equivalent_i (unaliased_tc.in ());
Expand Down