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 /ucb/source/cacher | |
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 'ucb/source/cacher')
-rw-r--r-- | ucb/source/cacher/cachedcontentresultset.cxx | 2 | ||||
-rw-r--r-- | ucb/source/cacher/dynamicresultsetwrapper.cxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx index 8fbda792c435..3adfcc45a225 100644 --- a/ucb/source/cacher/cachedcontentresultset.cxx +++ b/ucb/source/cacher/cachedcontentresultset.cxx @@ -249,7 +249,7 @@ Sequence< sal_Bool >& CachedContentResultSet::CCRS_Cache { sal_Int32 nCount = m_pResult->Rows.getLength(); m_pMappedReminder.emplace( nCount ); - std::fill_n(m_pMappedReminder->begin(), m_pMappedReminder->getLength(), false); + std::fill_n(m_pMappedReminder->getArray(), m_pMappedReminder->getLength(), false); } return *m_pMappedReminder; } diff --git a/ucb/source/cacher/dynamicresultsetwrapper.cxx b/ucb/source/cacher/dynamicresultsetwrapper.cxx index 12bac33b5f57..e465bbe6da0c 100644 --- a/ucb/source/cacher/dynamicresultsetwrapper.cxx +++ b/ucb/source/cacher/dynamicresultsetwrapper.cxx @@ -220,7 +220,7 @@ void DynamicResultSetWrapper::impl_notify( const ListEvent& Changes ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); - for( ListAction& rAction : aNewEvent.Changes ) + for( ListAction& rAction : asNonConstRange(aNewEvent.Changes) ) { if (m_bGotWelcome) break; |