Remove non-const Sequence::begin()/end() in internal code
commit2484de6728bd11bb7949003d112f1ece2223c7a1
authorMike Kaganski <mike.kaganski@collabora.com>
Thu, 14 Oct 2021 07:25:24 +0000 (14 09:25 +0200)
committerMike Kaganski <mike.kaganski@collabora.com>
Fri, 15 Oct 2021 08:36:36 +0000 (15 10:36 +0200)
tree1296534e396da284b38d2c478dcd2b31c4714179
parent88375fd36899d21d3309cf8333712e02a87d3a91
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>
217 files changed:
UnoControls/source/base/basecontainercontrol.cxx
accessibility/source/standard/vclxaccessibleedit.cxx
basctl/source/basicide/scriptdocument.cxx
chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
chart2/source/model/template/ColumnLineDataInterpreter.cxx
chart2/source/tools/ReferenceSizeProvider.cxx
chart2/source/view/axes/VCoordinateSystem.cxx
chart2/source/view/main/VDataSeries.cxx
comphelper/source/property/opropertybag.cxx
comphelper/source/property/property.cxx
comphelper/source/property/propertycontainerhelper.cxx
compilerplugins/clang/sequenceloop.cxx [deleted file]
compilerplugins/clang/test/constvars.cxx
compilerplugins/clang/test/sequenceloop.cxx [deleted file]
configmgr/source/writemodfile.cxx
connectivity/source/commontools/ConnectionWrapper.cxx
connectivity/source/commontools/dbtools.cxx
connectivity/source/drivers/jdbc/JStatement.cxx
connectivity/source/drivers/odbc/OStatement.cxx
connectivity/source/sdbcx/VDescriptor.cxx
cppuhelper/source/factory.cxx
cui/source/customize/cfg.cxx
cui/source/dialogs/AdditionsDialog.cxx
cui/source/options/optaboutconfig.cxx
cui/source/options/optgenrl.cxx
dbaccess/source/core/api/TableDeco.cxx
dbaccess/source/core/api/definitioncolumn.cxx
dbaccess/source/core/api/table.cxx
dbaccess/source/core/dataaccess/databasedocument.cxx
dbaccess/source/core/dataaccess/datasource.cxx
dbaccess/source/filter/xml/xmlExport.cxx
dbaccess/source/ui/browser/formadapter.cxx
dbaccess/source/ui/browser/sbamultiplex.cxx
dbaccess/source/ui/browser/unodatbr.cxx
dbaccess/source/ui/misc/dbsubcomponentcontroller.cxx
dbaccess/source/ui/querydesign/querycontroller.cxx
desktop/source/lib/init.cxx
editeng/source/accessibility/AccessibleEditableTextPara.cxx
embeddedobj/source/commonembedding/embedobj.cxx
extensions/source/propctrlr/formcomponenthandler.cxx
extensions/source/propctrlr/stringrepresentation.cxx
filter/source/pdf/pdffilter.cxx
forms/source/misc/InterfaceContainer.cxx
framework/source/fwe/classes/addonsoptions.cxx
i18npool/source/calendar/calendarImpl.cxx
i18npool/source/collator/collatorImpl.cxx
i18npool/source/localedata/localedata.cxx
i18npool/source/transliteration/ignoreIandEfollowedByYa_ja_JP.cxx
i18npool/source/transliteration/ignoreIterationMark_ja_JP.cxx
i18npool/source/transliteration/ignoreKiKuFollowedBySa_ja_JP.cxx
i18npool/source/transliteration/ignoreProlongedSoundMark_ja_JP.cxx
i18npool/source/transliteration/transliterationImpl.cxx
i18npool/source/transliteration/transliteration_OneToOne.cxx
i18npool/source/transliteration/transliteration_body.cxx
include/com/sun/star/uno/Sequence.h
include/com/sun/star/uno/Sequence.hxx
include/comphelper/basicio.hxx
include/comphelper/propertysequence.hxx
include/comphelper/sequence.hxx
linguistic/source/lngsvcmgr.cxx
oox/source/drawingml/customshapeproperties.cxx
oox/source/export/chartexport.cxx
oox/source/export/drawingml.cxx
oox/source/vml/vmlformatting.cxx
package/source/xstor/owriteablestream.cxx
package/source/zipapi/ThreadedDeflater.cxx
pyuno/source/module/pyuno_adapter.cxx
reportdesign/source/core/api/ReportDefinition.cxx
reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
reportdesign/source/ui/report/ReportSection.cxx
sc/qa/unit/subsequent_filters_test2.cxx
sc/source/core/data/dpobject.cxx
sc/source/core/data/dptabsrc.cxx
sc/source/core/tool/charthelper.cxx
sc/source/filter/excel/xechart.cxx
sc/source/filter/ftools/fapihelper.cxx
sc/source/ui/Accessibility/AccessibleCell.cxx
sc/source/ui/miscdlgs/optsolver.cxx
sc/source/ui/miscdlgs/solveroptions.cxx
sc/source/ui/unoobj/cellsuno.cxx
sc/source/ui/unoobj/chart2uno.cxx
sc/source/ui/unoobj/dapiuno.cxx
sc/source/ui/unoobj/defltuno.cxx
sc/source/ui/unoobj/dispuno.cxx
sc/source/ui/unoobj/docuno.cxx
sc/source/ui/unoobj/funcuno.cxx
sc/source/ui/unoobj/shapeuno.cxx
sc/source/ui/unoobj/styleuno.cxx
sc/source/ui/vba/vbachart.cxx
sc/source/ui/vba/vbaeventshelper.cxx
sc/source/ui/vba/vbaworkbook.cxx
sc/source/ui/vba/vbaworkbook.hxx
sc/source/ui/vba/vbawsfunction.cxx
sccomp/source/solver/SwarmSolver.cxx
scripting/source/protocolhandler/scripthandler.cxx
scripting/source/provider/BrowseNodeFactoryImpl.cxx
sd/source/core/CustomAnimationCloner.cxx
sd/source/core/CustomAnimationEffect.cxx
sd/source/core/stlsheet.cxx
sd/source/filter/eppt/pptx-epptooxml.cxx
sd/source/filter/grf/sdgrffilter.cxx
sd/source/filter/ppt/pptinanimations.cxx
sd/source/ui/unoidl/unomodule.cxx
sd/source/ui/unoidl/unopage.cxx
sd/source/ui/unoidl/unopback.cxx
sdext/source/minimizer/pppoptimizerdialog.cxx
sfx2/source/appl/appdispatchprovider.cxx
sfx2/source/appl/helpinterceptor.cxx
sfx2/source/appl/macroloader.cxx
sfx2/source/control/templatelocalview.cxx
sfx2/source/control/unoctitm.cxx
sfx2/source/dialog/backingcomp.cxx
sfx2/source/dialog/dinfdlg.cxx
sfx2/source/dialog/filedlghelper.cxx
sfx2/source/dialog/filtergrouping.cxx
sfx2/source/doc/doctemplates.cxx
sfx2/source/doc/sfxbasemodel.cxx
sfx2/source/view/sfxbasecontroller.cxx
sfx2/source/view/viewprn.cxx
slideshow/source/engine/opengl/TransitionerImpl.cxx
solenv/CompilerTest_compilerplugins_clang.mk
starmath/source/cfgitem.cxx
starmath/source/mathml/mathmlexport.cxx
stoc/source/implementationregistration/implreg.cxx
stoc/source/invocation/invocation.cxx
stoc/source/servicemanager/servicemanager.cxx
svl/qa/unit/lockfiles/test_lockfiles.cxx
svl/source/config/asiancfg.cxx
svl/source/misc/PasswordHelper.cxx
svl/source/numbers/zforlist.cxx
svl/source/passwordcontainer/passwordcontainer.cxx
svtools/source/config/extcolorcfg.cxx
svtools/source/uno/popupmenucontrollerbase.cxx
svx/source/accessibility/AccessibleControlShape.cxx
svx/source/dialog/SvxNumOptionsTabPageHelper.cxx
svx/source/dialog/rubydialog.cxx
svx/source/fmcomp/fmgridcl.cxx
svx/source/fmcomp/fmgridif.cxx
svx/source/form/formdispatchinterceptor.cxx
svx/source/table/cell.cxx
svx/source/tbxctrls/tbunosearchcontrollers.cxx
svx/source/unodraw/UnoGraphicExporter.cxx
svx/source/unodraw/unoshape.cxx
sw/qa/extras/globalfilter/globalfilter.cxx
sw/qa/extras/ooxmlexport/ooxmlexport14.cxx
sw/qa/extras/ooxmlimport/ooxmlimport.cxx
sw/source/core/access/accpara.cxx
sw/source/core/unocore/SwXTextDefaults.cxx
sw/source/core/unocore/unochart.cxx
sw/source/core/unocore/unodraw.cxx
sw/source/core/unocore/unofield.cxx
sw/source/core/unocore/unoframe.cxx
sw/source/core/unocore/unoftn.cxx
sw/source/core/unocore/unoobj.cxx
sw/source/core/unocore/unoparagraph.cxx
sw/source/core/unocore/unoport.cxx
sw/source/core/unocore/unostyle.cxx
sw/source/core/unocore/unotbl.cxx
sw/source/filter/ww8/ww8par3.cxx
sw/source/filter/xml/wrtxml.cxx
sw/source/ui/dbui/mmaddressblockpage.cxx
sw/source/ui/envelp/mailmrge.cxx
sw/source/ui/vba/vbadocumentproperties.cxx
sw/source/ui/vba/vbafilterpropsfromformat.hxx
sw/source/ui/vba/vbatabstops.cxx
sw/source/uibase/dbui/dbtree.cxx
sw/source/uibase/dbui/mmconfigitem.cxx
sw/source/uibase/fldui/fldmgr.cxx
sw/source/uibase/misc/numberingtypelistbox.cxx
sw/source/uibase/uno/unodispatch.cxx
sw/source/uibase/uno/unomodule.cxx
sw/source/uibase/uno/unotxdoc.cxx
test/source/sheet/databaseimportdescriptor.cxx
toolkit/source/controls/controlmodelcontainerbase.cxx
toolkit/source/controls/geometrycontrolmodel.cxx
toolkit/source/controls/stdtabcontroller.cxx
toolkit/source/controls/unocontrol.cxx
toolkit/source/controls/unocontrolcontainer.cxx
toolkit/source/controls/unocontrolmodel.cxx
toolkit/source/controls/unocontrols.cxx
ucb/source/cacher/cachedcontentresultset.cxx
ucb/source/cacher/dynamicresultsetwrapper.cxx
ucb/source/ucp/cmis/cmis_content.cxx
ucb/source/ucp/ext/ucpext_content.cxx
ucb/source/ucp/file/filnot.cxx
ucb/source/ucp/file/filtask.cxx
ucbhelper/source/provider/contentinfo.cxx
ucbhelper/source/provider/resultsetmetadata.cxx
unotools/source/config/cmdoptions.cxx
unotools/source/config/configitem.cxx
unotools/source/config/confignode.cxx
unotools/source/config/lingucfg.cxx
unotools/source/config/moduleoptions.cxx
unotools/source/config/viewoptions.cxx
unotools/source/i18n/localedatawrapper.cxx
vbahelper/source/msforms/vbalistcontrolhelper.cxx
vbahelper/source/vbahelper/vbahelper.cxx
vcl/qa/cppunit/canvasbitmaptest.cxx
vcl/qt5/QtAccessibleWidget.cxx
vcl/source/filter/graphicfilter.cxx
vcl/source/gdi/configsettings.cxx
vcl/source/gdi/print3.cxx
vcl/source/gdi/vectorgraphicdata.cxx
vcl/source/graphic/UnoGraphic.cxx
vcl/source/uitest/uitest.cxx
vcl/unx/generic/dtrans/X11_transferable.cxx
writerfilter/source/dmapper/DomainMapper_Impl.cxx
xmlhelp/source/cxxhelp/provider/content.cxx
xmloff/source/chart/SchXMLExport.cxx
xmloff/source/chart/SchXMLSeries2Context.cxx
xmloff/source/core/PropertySetMerger.cxx
xmloff/source/draw/shapeexport.cxx
xmloff/source/forms/elementimport.cxx
xmloff/source/forms/propertyexport.cxx
xmloff/source/text/txtimp.cxx
xmloff/source/transform/OOo2Oasis.cxx
xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx