Skip to content

Modernize GenCountersFSR and GenFSR

Gerhard Raven requested to merge modernize-GenFSR into master
  • GenCountersFSR does not contain any member data (only a static mapping of enum to string), so make it non-instantiable, and remove inheritance from DataObject
  • use enum->string mapping instead of expensive error prone string->string mapping
    • bug fix: the string-to-string mapping contained "Dsminus0Gen" and "Dsminus0Acc" which should have "DsminusGen" and "DsminusAcc" respectively (split into !3137 (merged))
  • GenFSR:
    • remove expensive conversion of enum to string, followed by string comparisons (error prone, as the compiler cannot check for misspeliing, but can check for invalid enum values) and conversion back to enum
    • allow lookup by string_view to avoid having to create std::string when a literal string is passed
    • prefer STL algorithms and range-based loops
    • remove (unused) illogical operator+ (but leave operator+=!) (note: after doing c = a + b, one would have that a == c, i.e. operator+ modified its left argument... )
    • do not rebuild the same expensive string -> string map on every call to getFullNames
Edited by Gerhard Raven

Merge request reports

Loading