Re: cppcheck algorithm suggestions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Saturday 23 of January 2021, Dr. David Alan Gilbert wrote:
> Hi,
>   What are peoples feelings for cppcheck's suggestions for stl algorithms?
> In https://gerrit.libreoffice.org/c/core/+/109846 I did a 'any_of'
> and a 'accumulate' that it suggested;  the any_of does look better,
> the accumulate seems marginally better.

 To me they both seem as a regression. I find the original code easily 
readable, I just look and see, while I need to "decypher" the std algo code.

> Does the project/people have general preferences on whether it's
> worth tackling these suggestions?
>
> I was less sure what to do with the suggestions for 'transform';
> some of them were replacing very simple loops; another
> was using emplace_back to add the results to the destination and I wasn't
> sure what I'd pass into transform for the equivalent.

 Suggestions from an automated tool are just that, suggestions. IMO common 
sense should be a higher priority than blindly following an automated tool.

-- 
 Luboš Luňák
 l.lunak@xxxxxxxxxxxxx
_______________________________________________
LibreOffice mailing list
LibreOffice@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/libreoffice




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux