New Defects reported by Coverity Scan for LibreOffice

Stephan Bergmann sbergman at redhat.com
Mon Jun 13 07:15:46 UTC 2022


On 10/06/2022 18:06, scan-admin at coverity.com wrote:
> *** CID 1505368:  Performance inefficiencies  (PASS_BY_VALUE)
> /editeng/source/editeng/editdoc.cxx: 1196 in ContentNode::ContentNode(rtl::OUString, ContentAttribs)()
> 1190     }
> 1191
> 1192     ContentNode::ContentNode( SfxItemPool& rPool ) : aContentAttribs( rPool )
> 1193     {
> 1194     }
> 1195
>>>>      CID 1505368:  Performance inefficiencies  (PASS_BY_VALUE)
>>>>      Passing parameter _aContentAttribs of type "ContentAttribs" (size 488 bytes) by value.
> 1196     ContentNode::ContentNode( OUString aStr, ContentAttribs _aContentAttribs ) :
> 1197         maString(std::move(aStr)), aContentAttribs(std::move(_aContentAttribs))
> 1198     {
> 1199     }
> 1200
> 1201     ContentNode::~ContentNode()

There's been a handful of such Coverity reports lately.  Doesn't it look 
like clang-tidy modernize-pass-by-value gives potentially poor advice 
here, but which we followed blindly in commits like 
<https://git.libreoffice.org/core/+/91fef4a47563451e0271784a14b471e4815729d1%5E!/> 
"clang-tidy modernize-pass-by-value in editeng"?



More information about the LibreOffice mailing list