diff --git a/include/rtl/stringconcat.hxx b/include/rtl/stringconcat.hxx index 0bed28ac810c..216670e0d635 100644 --- a/include/rtl/stringconcat.hxx +++ b/include/rtl/stringconcat.hxx @@ -16,6 +16,7 @@ #include "rtl/string.h" #include "rtl/ustring.h" +#include #include #include #include @@ -82,14 +83,6 @@ C* addDataHelper( C* buffer, const C* data, std::size_t length ) return buffer + length; } -inline -sal_Unicode* addDataLiteral( sal_Unicode* buffer, const char* data, std::size_t length ) -{ - for( std::size_t i = 0; i != length; ++i ) - *buffer++ = *data++; - return buffer; -} - template inline C* addDataString( C* buffer, const C* str ) { @@ -126,7 +119,7 @@ struct ToStringHelper< const char[ N ] > { static std::size_t length( const char str[ N ] ) { (void)str; assert( strlen( str ) == N - 1 ); return N - 1; } char* operator()( char* buffer, const char str[ N ] ) const { return addDataHelper( buffer, str, N - 1 ); } - sal_Unicode* operator()( sal_Unicode* buffer, const char str[ N ] ) const { return addDataLiteral( buffer, str, N - 1 ); } + sal_Unicode* operator()( sal_Unicode* buffer, const char str[ N ] ) const { return std::copy_n( str, N - 1, buffer ); } }; template<>