diff --git a/Alignment/CommonAlignment/src/MisalignmentScenarioBuilder.cc b/Alignment/CommonAlignment/src/MisalignmentScenarioBuilder.cc index a71020bb22547..02cf5050a497f 100644 --- a/Alignment/CommonAlignment/src/MisalignmentScenarioBuilder.cc +++ b/Alignment/CommonAlignment/src/MisalignmentScenarioBuilder.cc @@ -366,19 +366,19 @@ bool MisalignmentScenarioBuilder::possiblyPartOf(const std::string & /*sub*/, co const std::string MisalignmentScenarioBuilder::rootName_( const std::string& parameterSetName ) const { + std::string result{parameterSetName}; // Initialise to full string - std::string result = parameterSetName; // Initialise to full string - // Check if string ends with 's' - const int lastChar = parameterSetName.length()-1; + const auto lastChar = parameterSetName.length()-1; if ( parameterSetName[lastChar] == 's' ) { result = parameterSetName.substr( 0, lastChar ); } else { - // Otherwise, look for numbers (assumes names have no numbers inside...) - for ( unsigned int ichar = 0; ichar