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 /sdext | |
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 'sdext')
-rw-r--r-- | sdext/source/minimizer/pppoptimizerdialog.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sdext/source/minimizer/pppoptimizerdialog.cxx b/sdext/source/minimizer/pppoptimizerdialog.cxx index 30e1b621f2b0..74a89bfbac1a 100644 --- a/sdext/source/minimizer/pppoptimizerdialog.cxx +++ b/sdext/source/minimizer/pppoptimizerdialog.cxx @@ -78,7 +78,7 @@ Sequence< Reference< css::frame::XDispatch > > SAL_CALL PPPOptimizerDialog::quer const Sequence< css::frame::DispatchDescriptor >& aDescripts ) { Sequence< Reference< css::frame::XDispatch> > aReturn( aDescripts.getLength() ); - std::transform(aDescripts.begin(), aDescripts.end(), aReturn.begin(), + std::transform(aDescripts.begin(), aDescripts.end(), aReturn.getArray(), [this](const css::frame::DispatchDescriptor& rDescr) -> Reference<css::frame::XDispatch> { return queryDispatch(rDescr.FeatureURL, rDescr.FrameName, rDescr.SearchFlags); }); return aReturn; |