[Libreoffice-commits] core.git: include/rtl

Noel (via logerrit) logerrit at kemper.freedesktop.org
Fri Dec 18 10:51:33 UTC 2020


 include/rtl/strbuf.hxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit ccb3fed37d849a88c74594c44f2aec68c808a33f
Author:     Noel <noel.grandin at collabora.co.uk>
AuthorDate: Fri Dec 18 11:20:01 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Dec 18 11:50:55 2020 +0100

    add OStringBuffer::append(std::string_view)
    
    so we don't need to construct an OString when appending from a view
    
    Change-Id: I8105d916b43215e312857e9d9d00a38c3d833861
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107938
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/rtl/strbuf.hxx b/include/rtl/strbuf.hxx
index 074d1278ea86..2f2df8624f25 100644
--- a/include/rtl/strbuf.hxx
+++ b/include/rtl/strbuf.hxx
@@ -30,6 +30,7 @@
 
 #ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
 #include "rtl/stringconcat.hxx"
+#include <string_view>
 #endif
 
 #ifdef RTL_STRING_UNITTEST
@@ -585,6 +586,15 @@ public:
         return append( c.buf, c.length );
     }
 
+    /**
+     @overload
+     @internal
+     */
+    OStringBuffer& append( std::string_view s )
+    {
+        return append( s.data(), s.size() );
+    }
+
 #endif
 
     /**


More information about the Libreoffice-commits mailing list