diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-14 09:25:24 +0200 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-15 10:36:36 +0200 |
commit | 2484de6728bd11bb7949003d112f1ece2223c7a1 (patch) | |
tree | 1296534e396da284b38d2c478dcd2b31c4714179 /sd/source/ui/unoidl | |
parent | 88375fd36899d21d3309cf8333712e02a87d3a91 (diff) |
Remove non-const Sequence::begin()/end() in internal code
... to avoid hidden cost of multiple COW checks, because they
call getArray() internally.
This obsoletes [loplugin:sequenceloop].
Also rename toNonConstRange to asNonConstRange, to reflect that
the result is a view of the sequence, not an independent object.
TODO: also drop non-const operator[], but introduce operator[]
in SequenceRange.
Change-Id: Idd5fd7a3400fe65274d2a6343025e2ef8911635d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123518
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd/source/ui/unoidl')
-rw-r--r-- | sd/source/ui/unoidl/unomodule.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopage.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopback.cxx | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/sd/source/ui/unoidl/unomodule.cxx b/sd/source/ui/unoidl/unomodule.cxx index 0ea5527b3548..d862f7c9dd36 100644 --- a/sd/source/ui/unoidl/unomodule.cxx +++ b/sd/source/ui/unoidl/unomodule.cxx @@ -81,7 +81,7 @@ uno::Sequence< uno::Reference< frame::XDispatch > > SAL_CALL SdUnoModule::queryD sal_Int32 nCount = seqDescripts.getLength(); uno::Sequence< uno::Reference< frame::XDispatch > > lDispatcher( nCount ); - std::transform(seqDescripts.begin(), seqDescripts.end(), lDispatcher.begin(), + std::transform(seqDescripts.begin(), seqDescripts.end(), lDispatcher.getArray(), [this](const frame::DispatchDescriptor& rDescr) -> uno::Reference<frame::XDispatch> { return queryDispatch(rDescr.FeatureURL, rDescr.FrameName, rDescr.SearchFlags); }); diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index d1284cf46789..984b5fd0df2c 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -1324,7 +1324,7 @@ Sequence< Any > SAL_CALL SdGenericDrawPage::getPropertyValues( const Sequence< O { sal_Int32 nCount = aPropertyNames.getLength(); Sequence< Any > aValues( nCount ); - std::transform(aPropertyNames.begin(), aPropertyNames.end(), aValues.begin(), + std::transform(aPropertyNames.begin(), aPropertyNames.end(), aValues.getArray(), [this](const OUString& rName) -> Any { Any aValue; try diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx index 7faba9b450b6..508b1f8662fc 100644 --- a/sd/source/ui/unoidl/unopback.cxx +++ b/sd/source/ui/unoidl/unopback.cxx @@ -348,7 +348,7 @@ uno::Sequence< beans::PropertyState > SAL_CALL SdUnoPageBackground::getPropertyS uno::Sequence< beans::PropertyState > aPropertyStateSequence( nCount ); - std::transform(aPropertyName.begin(), aPropertyName.end(), aPropertyStateSequence.begin(), + std::transform(aPropertyName.begin(), aPropertyName.end(), aPropertyStateSequence.getArray(), [this](const OUString& rName) -> beans::PropertyState { return getPropertyState(rName); }); return aPropertyStateSequence; |