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

Noel Grandin noel.grandin at collabora.co.uk
Mon Jun 19 09:06:20 UTC 2017


 include/comphelper/sequence.hxx |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

New commits:
commit f0d3a9bb00e11ca697666dd4e6f9c4dea38c7b31
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Jun 19 10:02:50 2017 +0200

    simplify the array version of comphelper::containerToSequence
    
    Change-Id: I85c0baa32b37201fc2caaa4e5bd390e060241265
    Reviewed-on: https://gerrit.libreoffice.org/38951
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/comphelper/sequence.hxx b/include/comphelper/sequence.hxx
index 8fba7b8722b1..26d08c993c1e 100644
--- a/include/comphelper/sequence.hxx
+++ b/include/comphelper/sequence.hxx
@@ -301,12 +301,10 @@ namespace comphelper
     }
 
     // handle arrays
-    template<typename SrcElementType, std::size_t SrcSize>
-    inline css::uno::Sequence< SrcElementType > containerToSequence( SrcElementType const (&i_Array)[ SrcSize ] )
+    template<typename ElementType, std::size_t SrcSize>
+    inline css::uno::Sequence< ElementType > containerToSequence( ElementType const (&i_Array)[ SrcSize ] )
     {
-        css::uno::Sequence< SrcElementType > result( SrcSize );
-        ::std::copy( std::begin(i_Array), std::end(i_Array), result.getArray() );
-        return result;
+        return css::uno::Sequence< ElementType >( i_Array, SrcSize );
     }
 
     template <typename T>


More information about the Libreoffice-commits mailing list