From 0a9ef5a18e148c7a5c9a088e153a7873d1564841 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 5 Nov 2013 11:06:18 +0200 Subject: convert OUString 0==compareToAscii to equalsAscii Convert code like: 0 == aStr.compareToAscii("XXX") to aStr.equalsAscii("XXX") which is both clearer and faster. Change-Id: I2e906d7d38494db38eb292702fadb781b1251e07 --- io/test/stm/datatest.cxx | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'io') diff --git a/io/test/stm/datatest.cxx b/io/test/stm/datatest.cxx index 3e80f09e382e..b556aab6192c 100644 --- a/io/test/stm/datatest.cxx +++ b/io/test/stm/datatest.cxx @@ -462,28 +462,28 @@ void MyPersistObject::setPropertyValue( WrappedTargetException, RuntimeException) { - if( 0 == aPropertyName.compareToAscii("long") ) { + if( aPropertyName.equalsAscii("long") ) { aValue >>= m_l; } - else if ( 0 == aPropertyName.compareToAscii("float") ) { + else if ( aPropertyName.equalsAscii("float") ) { aValue >>= m_f; } - else if( 0 == aPropertyName.compareToAscii("double") ) { + else if( aPropertyName.equalsAscii("double") ) { aValue >>= m_d; } - else if( 0 == aPropertyName.compareToAscii("bool") ) { + else if( aPropertyName.equalsAscii("bool") ) { aValue >>= m_b; } - else if( 0 == aPropertyName.compareToAscii("byte" ) ) { + else if( aPropertyName.equalsAscii("byte" ) ) { aValue >>= m_byte; } - else if( 0 == aPropertyName.compareToAscii("char") ) { + else if( aPropertyName.equalsAscii("char") ) { aValue >>= m_c; } - else if( 0 == aPropertyName.compareToAscii("string") ) { + else if( aPropertyName.equalsAscii("string") ) { aValue >>= m_s; } - else if( 0 == aPropertyName.compareToAscii("object") ) { + else if( aPropertyName.equalsAscii("object") ) { if( aValue.getValueType() == getCppuType( (Reference< XPersistObject> *)0 ) ) { aValue >>= m_ref; @@ -502,28 +502,28 @@ Any MyPersistObject::getPropertyValue(const OUString& aPropertyName) RuntimeException) { Any aValue; - if( 0 == aPropertyName.compareToAscii("long" ) ) { + if( aPropertyName.equalsAscii("long" ) ) { aValue <<= m_l; } - else if ( 0 == aPropertyName.compareToAscii("float") ) { + else if ( aPropertyName.equalsAscii("float") ) { aValue <<= m_f; } - else if( 0 == aPropertyName.compareToAscii("double") ) { + else if( aPropertyName.equalsAscii("double") ) { aValue <<= m_d; } - else if( 0 == aPropertyName.compareToAscii("bool") ) { + else if( aPropertyName.equalsAscii("bool") ) { aValue <<= m_b; } - else if( 0 == aPropertyName.compareToAscii("byte") ) { + else if( aPropertyName.equalsAscii("byte") ) { aValue <<= m_byte; } - else if( 0 == aPropertyName.compareToAscii("char" ) ) { + else if( aPropertyName.equalsAscii("char" ) ) { aValue <<= m_c; } - else if( 0 == aPropertyName.compareToAscii("string") ) { + else if( aPropertyName.equalsAscii("string") ) { aValue <<= m_s; } - else if( 0 == aPropertyName.compareToAscii("object" ) ) + else if( aPropertyName.equalsAscii("object" ) ) { aValue <<= m_ref; } @@ -699,8 +699,8 @@ sal_Int32 OObjectStreamTest::test( const OUString& TestName, throw ( IllegalArgumentException, RuntimeException) { - if( 0 == TestName.compareToAscii("com.sun.star.io.ObjectInputStream") || - 0 == TestName.compareToAscii("com.sun.star.io.ObjectOutputStream" ) ) { + if( TestName.equalsAscii("com.sun.star.io.ObjectInputStream") || + TestName.equalsAscii("com.sun.star.io.ObjectOutputStream") ) { try { -- cgit