clang-tidy modernize-pass-by-value in jvmaccess

Change-Id: I9a2ef4370136b0f26ae3590f358025e7d89f30d2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134757
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2022-05-23 10:03:30 +02:00
parent f4efaf4551
commit 0c17712465
4 changed files with 8 additions and 7 deletions

View file

@ -64,8 +64,7 @@ public:
@exception CreationException
Thrown in case creation fails (due to a JNI problem).
*/
UnoVirtualMachine(rtl::Reference<jvmaccess::VirtualMachine> const& virtualMachine,
void* classLoader);
UnoVirtualMachine(rtl::Reference<jvmaccess::VirtualMachine> virtualMachine, void* classLoader);
/** Get the Java virtual machine wrapper.

View file

@ -73,7 +73,7 @@ public:
@exception CreationException
Thrown in case attaching fails (due to a JNI problem).
*/
explicit AttachGuard(rtl::Reference<VirtualMachine> const& rMachine);
explicit AttachGuard(rtl::Reference<VirtualMachine> xMachine);
/** Detach the current thread from the virtual machine again.
*/

View file

@ -23,6 +23,7 @@
#include <jvmaccess/virtualmachine.hxx>
#include <sal/log.hxx>
#include <utility>
#include <jni.h>
@ -40,9 +41,9 @@ UnoVirtualMachine::CreationException::operator =(CreationException const &) {
}
UnoVirtualMachine::UnoVirtualMachine(
rtl::Reference< jvmaccess::VirtualMachine > const & virtualMachine,
rtl::Reference< jvmaccess::VirtualMachine > virtualMachine,
void * classLoader):
m_virtualMachine(virtualMachine),
m_virtualMachine(std::move(virtualMachine)),
m_classLoader(nullptr)
{
try {

View file

@ -23,6 +23,7 @@
#include <jvmaccess/virtualmachine.hxx>
#include <sal/log.hxx>
#include <utility>
using jvmaccess::VirtualMachine;
@ -41,8 +42,8 @@ VirtualMachine::AttachGuard::CreationException::operator =(
}
VirtualMachine::AttachGuard::AttachGuard(
rtl::Reference< VirtualMachine > const & rMachine):
m_xMachine(rMachine)
rtl::Reference< VirtualMachine > xMachine):
m_xMachine(std::move(xMachine))
{
assert(m_xMachine.is());
m_pEnvironment = m_xMachine->attachThread(&m_bDetach);