Use emptiness check rather than size check for efficiency

This commit is contained in:
Mariusz Dykierek
2012-02-17 15:18:29 +00:00
committed by Michael Meeks
parent b7a0b9e519
commit df69ab8a80
2 changed files with 2 additions and 2 deletions

View File

@@ -120,7 +120,7 @@ sal_Bool CFormatEtcContainer::hasFormatEtc( const CFormatEtc& fetc ) const
sal_Bool CFormatEtcContainer::hasElements( ) const sal_Bool CFormatEtcContainer::hasElements( ) const
{ {
return ( m_FormatMap.size( ) > 0 ); return !m_FormatMap.empty();
} }
//------------------------------------------------------------------------ //------------------------------------------------------------------------

View File

@@ -482,7 +482,7 @@ typedef Sequence<sal_Int8> ByteSequence_t;
a double '\0' terminated string buffer */ a double '\0' terminated string buffer */
size_t CalcSizeForStringListBuffer(const FileList_t& fileList) size_t CalcSizeForStringListBuffer(const FileList_t& fileList)
{ {
if (fileList.size() == 0) if ( fileList.empty() )
return 0; return 0;
size_t size = 1; // one for the very final '\0' size_t size = 1; // one for the very final '\0'