diff --git a/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTChain.cxx b/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTChain.cxx index 1967aae12aab8e2ba0f29106c36799cb7cc729fc..732e62f275097b2bd85408b0bc6c945a65cd5259 100644 --- a/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTChain.cxx +++ b/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTChain.cxx @@ -186,9 +186,9 @@ namespace { return stream; } for(auto stream : streams) { - string s(stream->name()); - if( (s.find('.') != string::npos) && - (s.substr(s.find('.')+1) == streamName) ) + const string &s(stream->name()); + if( auto p = s.find('.'); (p != string::npos) && + (s.compare(p+1, streamName.size(), streamName) == 0) ) return stream; } return nullptr; diff --git a/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTUtils.cxx b/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTUtils.cxx index d29913281613a0ec853d5afeb5768181e1ef2d04..9d17634d35f42adf130fee508fa2c4f32b8a1413 100644 --- a/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTUtils.cxx +++ b/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTUtils.cxx @@ -589,7 +589,7 @@ TrigConf::HLTTEUtils::mergeHLTChainList2( HLTFrame& frame) { // if name starts with EF_ it is replace with HLT_, otherwise HLT_ is prepended hltChain->set_level("HLT"); string oldname = chain->name(); - unsigned int basepos = (oldname.substr(0,3)=="EF_")?3:0; + unsigned int basepos = (oldname.compare(0,3,"EF_")==0)?3:0; hltChain->setName( "HLT_" + oldname.substr(basepos) ); diff --git a/Trigger/TrigT1/TrigT1TGC/src/LVL1TGCTrigger.cxx b/Trigger/TrigT1/TrigT1TGC/src/LVL1TGCTrigger.cxx index 47573a8639d227e75b06fa967d9498a1ee9d439e..2dff583b7c7fe85e62a6fcd5320c91a1c198a23c 100644 --- a/Trigger/TrigT1/TrigT1TGC/src/LVL1TGCTrigger.cxx +++ b/Trigger/TrigT1/TrigT1TGC/src/LVL1TGCTrigger.cxx @@ -1021,7 +1021,7 @@ void LVL1TGCTrigger::recordRdoSL(TGCSector* sector) if (fname.empty()) return StatusCode::SUCCESS; std::string fullName = PathResolver::find_file (fname.c_str(), "PWD"); - if( fullName.length() == 0 ) + if( fullName.empty()) fullName = PathResolver::find_file (fname.c_str(), "DATAPATH"); std::ifstream fin(fullName.c_str()); @@ -1035,7 +1035,7 @@ void LVL1TGCTrigger::recordRdoSL(TGCSector* sector) std::vector<std::string> mask; std::string aLine; while(getline(fin,aLine)) { - if (aLine.substr(0,3)!="///") break; + if (aLine.compare(0,3,"///")!=0) break; } int id_type = atoi(aLine.c_str()); while(getline(fin,aLine)) {