TrigOutputHandling: clang-tidy suggestions and small improvements
Apply a set of small changes and slight refactoring of the code driven mainly by clang-tidy warnings.
There's a lot of changes, but mostly trivial.
The addressed warnings (not always all cases, only where reasonable):
- use
= default
to define a trivial destructor [modernize-use-equals-default] - use
using
instead oftypedef
[modernize-use-using] - implicit conversions of pointers to
bool
[readability-implicit-bool-conversion] - implicit conversion from
bool
tochar
[readability-implicit-bool-conversion] - pass by value and use
std::move
[modernize-pass-by-value] - use nullptr [modernize-use-nullptr]
- all parameters should be named in a function [readability-named-parameter]
- implement the "rule of five" for
BareDataBucket
[cppcoreguidelines-special-member-functions] - implement the "rule of zero" for
TriggerEDMSerialiserTool::Address
- local copy of a variable never modified -> avoid the copy [performance-unnecessary-copy-initialization]
- some methods could be made static member functions or anonymous-namespace functions [readability-convert-member-functions-to-static]
- constructor does not initialize some fields [cppcoreguidelines-pro-type-member-init]
- use
empty()
instead ofsize()==0
[readability-container-size-empty] - some improvements to memory allocation, avoid
new
if possible [cppcoreguidelines-owning-memory] - do not use 'else' after 'return' [readability-else-after-return]
- function has a definition with different parameter names [readability-inconsistent-declaration-parameter-name]
- use a const reference instead of copy as loop variable [performance-for-range-copy]
- use
dynamic_cast
instead ofstatic_cast
to downcast from a base to a derived class [cppcoreguidelines-pro-type-static-cast-downcast] - use single-character overload of
string::find
when searching for a single character [performance-faster-string-find] -
const
values in declarations do not affect the signature of a function, so they should not be put there [readability-avoid-const-params-in-decls]