From 27be40762e9e10de05cdc0692eef8a8c6fd5a23c Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 13 May 2022 11:11:16 +0200 Subject: pass-by-value in TaskManager::MyProperty::setValue cheaper to move a temporary from some call-sites rather than copy-construct Change-Id: Ic1f994d0253c8368548295a08e83dfbbfae0a008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134307 Tested-by: Jenkins Reviewed-by: Noel Grandin --- ucb/source/ucp/file/filinl.hxx | 4 ++-- ucb/source/ucp/file/filtask.hxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'ucb') diff --git a/ucb/source/ucp/file/filinl.hxx b/ucb/source/ucp/file/filinl.hxx index b29d938def1c..3ea985ebc6cd 100644 --- a/ucb/source/ucp/file/filinl.hxx +++ b/ucb/source/ucp/file/filinl.hxx @@ -46,9 +46,9 @@ inline const sal_Int16& TaskManager::MyProperty::getAttributes() const { return Attributes; } -inline void TaskManager::MyProperty::setValue( const css::uno::Any& theValue ) const +inline void TaskManager::MyProperty::setValue( css::uno::Any theValue ) const { - const_cast(this)->Value = theValue; + const_cast(this)->Value = std::move(theValue); } inline void TaskManager::MyProperty::setState( const css::beans::PropertyState& theState ) const { diff --git a/ucb/source/ucp/file/filtask.hxx b/ucb/source/ucp/file/filtask.hxx index f8d070a4f36d..3fa4b85752ed 100644 --- a/ucb/source/ucp/file/filtask.hxx +++ b/ucb/source/ucp/file/filtask.hxx @@ -182,7 +182,7 @@ namespace fileaccess inline const sal_Int16& getAttributes() const; // The set* functions are declared const, because the key of "this" stays intact - inline void setValue( const css::uno::Any& theValue ) const; + inline void setValue( css::uno::Any theValue ) const; inline void setState( const css::beans::PropertyState& theState ) const; }; -- cgit