Kaydet (Commit) 12dc490c authored tarafından Stephan Bergmann's avatar Stephan Bergmann

No need for a buggy rewrite

... see 08bb8fca "#i122208# replace the
binaryurp cache for improved C++ compatibility" and
059f041d "cppcheck: fix duplicateExpression,"
when the only improvement is to not needlessly acquire/release raw rtl_uString
instances.

Change-Id: I734304b231d69f8089cbf1d35a3deda75f771c78
üst f2fd2a66
...@@ -32,16 +32,14 @@ ...@@ -32,16 +32,14 @@
namespace com { namespace sun { namespace star { namespace uno { namespace com { namespace sun { namespace star { namespace uno {
bool operator<( const TypeDescription& rLeft, const TypeDescription& rRight) { bool operator <(TypeDescription const & left, TypeDescription const & right) {
assert( rLeft.is() && rRight.is()); assert(left.is() && right.is());
const typelib_TypeDescription& rA = *rLeft.get(); typelib_TypeClass tc1 = left.get()->eTypeClass;
const typelib_TypeDescription& rB = *rRight.get(); typelib_TypeClass tc2 = right.get()->eTypeClass;
if( rA.eTypeClass != rB.eTypeClass) return tc1 < tc2 ||
return (rA.eTypeClass < rB.eTypeClass); (tc1 == tc2 &&
const sal_Int32 nCmp = rtl_ustr_compare_WithLength( (OUString::unacquired(&left.get()->pTypeName) <
rA.pTypeName->buffer, rA.pTypeName->length, OUString::unacquired(&right.get()->pTypeName)));
rB.pTypeName->buffer, rB.pTypeName->length);
return (nCmp < 0);
} }
bool TypeDescEqual::operator()( const TypeDescription& rLeft, const TypeDescription& rRight) const bool TypeDescEqual::operator()( const TypeDescription& rLeft, const TypeDescription& rRight) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment