Commit Graph

4 Commits

Author SHA1 Message Date
Stephan Bergmann
3a7d479c4c Improve loplugin:sequenceloop diagnostic advice
"make range var const" sounded to me like it talked about the variable declared
in the for-range-declaration, not a variable referenced in the for-range-
initializer

Change-Id: Ie777e1374ead7f37c8efb022cd87e980d2ee9810
Reviewed-on: https://gerrit.libreoffice.org/79563
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-09-25 22:14:02 +02:00
Noel Grandin
e87761688d use shared-plugin infra for some recent plugins
Change-Id: Ia9cba59718de91fed2045ffd7e0ec06d28bf37dc
Reviewed-on: https://gerrit.libreoffice.org/78118
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-26 13:48:13 +02:00
Stephan Bergmann
9a251699d7 Improve loplugin:sequenceloop warning
...from

> sfx2/source/appl/shutdowniconaqua.mm:416:13: error: use std::as_const, or make range var const, to avoid creating a copy of the Sequence [loplugin:sequenceloop]
>             for ( auto const & newMenuProp : aNewMenu )
>             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

to

> sfx2/source/appl/shutdowniconaqua.mm:416:46: error: use std::as_const, or make range var const, to avoid creating a copy of the Sequence [loplugin:sequenceloop]
>             for ( auto const & newMenuProp : aNewMenu )
>             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

Change-Id: I1eabe80abeed1784a246a6e3c9b7036f664ee681
Reviewed-on: https://gerrit.libreoffice.org/77989
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-08-23 14:40:19 +02:00
Noel Grandin
7d7a7862a7 new loplugin:sequenceloop
look for places we should be using std::as_const on for-range
loops over uno::Sequence, to avoid triggering a copy

Change-Id: I7efb641bf09d37c87946f03428ee4eec90298c8a
Reviewed-on: https://gerrit.libreoffice.org/77441
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-08-16 09:04:51 +02:00