loplugin:stringadd convert chained append to +
which can use the more efficient *StringConcat Also fix a crash in stringview plugin which started happening while I working on this. Change-Id: I91a5b9b7707d1594d27d80b73930f5afac8ae608 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114568 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -217,6 +217,10 @@ void f1(OUString s, OUString t, int i, const char* pChar)
|
||||
// no warning expected
|
||||
OUString c;
|
||||
c = c + OUString(pChar, strlen(pChar), RTL_TEXTENCODING_UTF8);
|
||||
|
||||
OUStringBuffer buf;
|
||||
// expected-error@+1 {{chained append, rather use single append call and + operator [loplugin:stringadd]}}
|
||||
buf.append(" ").append(b);
|
||||
}
|
||||
void f2(char ch)
|
||||
{
|
||||
|
Reference in New Issue
Block a user