include/o3tl/lazy_update.hxx |    4 +++-
 include/o3tl/vector_pool.hxx |    5 +++--
 2 files changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 343eed477ee7b55aa450bbc2aee6786dc0d9a071
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed May 18 11:55:25 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed May 18 14:08:45 2022 +0200

    clang-tidy modernize-pass-by-value in o3tl
    
    Change-Id: I420e023aa6bad3c960a9ec4c52f09b51cdd5ff6d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134520
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/o3tl/lazy_update.hxx b/include/o3tl/lazy_update.hxx
index ddff217a722c..a3053080c476 100644
--- a/include/o3tl/lazy_update.hxx
+++ b/include/o3tl/lazy_update.hxx
@@ -1,3 +1,5 @@
+#include <utility>
+
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
  * This file is part of the LibreOffice project.
@@ -46,7 +48,7 @@ output( myValue.getOutValue() );
      */
     template<typename In, typename Out, typename Func> class LazyUpdate {
     public:
-        LazyUpdate(Func const & func): func_(func), input_(), dirty_(true) {}
+        LazyUpdate(Func func): func_(std::move(func)), input_(), dirty_(true) 
{}
 
         In const & getInValue() const { return input_; }
 
diff --git a/include/o3tl/vector_pool.hxx b/include/o3tl/vector_pool.hxx
index 1b94f316f248..eec1a1a3c5af 100644
--- a/include/o3tl/vector_pool.hxx
+++ b/include/o3tl/vector_pool.hxx
@@ -20,6 +20,7 @@
 #ifndef INCLUDED_O3TL_VECTOR_POOL_HXX
 #define INCLUDED_O3TL_VECTOR_POOL_HXX
 
+#include <utility>
 #include <vector>
 
 namespace o3tl
@@ -84,8 +85,8 @@ namespace o3tl
                     value(),
                     nextFree(-1)
                 {}
-                explicit type( const ValueType& val ) :
-                    value(val),
+                explicit type( ValueType val ) :
+                    value(std::move(val)),
                     nextFree(-1)
                 {}
 

Reply via email to