diff options
author | Noel Grandin <noel@peralex.com> | 2015-12-02 12:58:50 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-12-03 06:37:51 +0000 |
commit | 73ed1178034fb391882d348f99699579cdff643a (patch) | |
tree | 8b0e0a5173e260124abf4938e722bde11824fec0 /include/com/sun/star/uno/Reference.hxx | |
parent | de9d0e797903e7ecc19be2b05c7e89d5936ae02d (diff) |
add move assignment and constructor to uno::Reference
"perf stat" says:
Before 14,009,233,975,201 cycles
After 13,660,876,595,941 cycles
i.e. shaved roughly 2% of the cycles
Change-Id: If604a125a8a5040281abd699678d0c791d5bbb51
Reviewed-on: https://gerrit.libreoffice.org/20350
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include/com/sun/star/uno/Reference.hxx')
-rw-r--r-- | include/com/sun/star/uno/Reference.hxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/com/sun/star/uno/Reference.hxx b/include/com/sun/star/uno/Reference.hxx index 498d5be4b46d..b25083d8e030 100644 --- a/include/com/sun/star/uno/Reference.hxx +++ b/include/com/sun/star/uno/Reference.hxx @@ -124,6 +124,15 @@ inline Reference< interface_type >::Reference( const Reference< interface_type > _pInterface->acquire(); } +#if defined LIBO_INTERNAL_ONLY +template< class interface_type > +inline Reference< interface_type >::Reference( Reference< interface_type > && rRef ) +{ + _pInterface = rRef._pInterface; + rRef._pInterface = nullptr; +} +#endif + template< class interface_type > template< class derived_type > inline Reference< interface_type >::Reference( const Reference< derived_type > & rRef, @@ -341,6 +350,18 @@ inline Reference< interface_type > & Reference< interface_type >::operator = ( return *this; } +#if defined LIBO_INTERNAL_ONLY +template< class interface_type > +inline Reference< interface_type > & Reference< interface_type >::operator = ( + Reference< interface_type > && rRef ) +{ + if (_pInterface) + _pInterface->release(); + _pInterface = rRef._pInterface; + rRef._pInterface = nullptr; + return *this; +} +#endif template< class interface_type > inline Reference< interface_type > Reference< interface_type >::query( |