Skip to content

Commit 1038c82

Browse files
committed
[ANALYSIS] Apply code checks/format
1 parent b205513 commit 1038c82

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

PhysicsTools/FWLite/src/CommandLineParser.cc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void CommandLineParser::parseArguments(int argc, char **argv, bool returnArgs) {
102102
}
103103

104104
void CommandLineParser::help() {
105-
if (m_usageString.length()) {
105+
if (!m_usageString.empty()) {
106106
cout << m_argv0 << " - " << m_usageString << endl;
107107
}
108108
cout << "--help - This screen" << endl
@@ -138,7 +138,7 @@ void CommandLineParser::split(SVec &retval, string line, string match, bool igno
138138
}
139139
string part = line.substr(pos, current - last - 1);
140140
// don't bother adding 0 length strings
141-
if (part.length()) {
141+
if (!part.empty()) {
142142
retval.push_back(part);
143143
}
144144
last = current;
@@ -208,7 +208,7 @@ void CommandLineParser::printOptionValues() {
208208
for (SIMapConstIter iter = m_integerMap.begin(); m_integerMap.end() != iter; ++iter) {
209209
const string &description = m_variableDescriptionMap[iter->first];
210210
cout << " " << setw(14) << iter->first << " = " << setw(14) << iter->second;
211-
if (description.length()) {
211+
if (!description.empty()) {
212212
cout << " - " << description;
213213
}
214214
cout << endl;
@@ -221,7 +221,7 @@ void CommandLineParser::printOptionValues() {
221221
for (SDMapConstIter iter = m_doubleMap.begin(); m_doubleMap.end() != iter; ++iter) {
222222
const string &description = m_variableDescriptionMap[iter->first];
223223
cout << " " << setw(14) << iter->first << " = " << setw(14) << iter->second;
224-
if (description.length()) {
224+
if (!description.empty()) {
225225
cout << " - " << description;
226226
}
227227
cout << endl;
@@ -239,7 +239,7 @@ void CommandLineParser::printOptionValues() {
239239
} else {
240240
cout << "false";
241241
}
242-
if (description.length()) {
242+
if (!description.empty()) {
243243
cout << " - " << description;
244244
}
245245
cout << endl;
@@ -254,7 +254,7 @@ void CommandLineParser::printOptionValues() {
254254
cout << " " << setw(14) << iter->first << " = ";
255255
const string value = "'" + iter->second + "'";
256256
cout << setw(14) << "";
257-
if (description.length()) {
257+
if (!description.empty()) {
258258
cout << " - " << description;
259259
}
260260
cout << endl << " " << value << endl;
@@ -269,7 +269,7 @@ void CommandLineParser::printOptionValues() {
269269
cout << " " << setw(14) << iter->first << " = ";
270270
dumpSTL(iter->second);
271271
cout << endl;
272-
if (description.length()) {
272+
if (!description.empty()) {
273273
cout << " - " << description;
274274
}
275275
cout << endl;
@@ -284,7 +284,7 @@ void CommandLineParser::printOptionValues() {
284284
cout << " " << setw(14) << iter->first << " = ";
285285
dumpSTL(iter->second);
286286
cout << endl;
287-
if (description.length()) {
287+
if (!description.empty()) {
288288
cout << " - " << description;
289289
}
290290
cout << endl;
@@ -299,7 +299,7 @@ void CommandLineParser::printOptionValues() {
299299
for (SSVecMapConstIter iter = m_stringVecMap.begin(); m_stringVecMap.end() != iter; ++iter) {
300300
const string &description = m_variableDescriptionMap[iter->first];
301301
cout << " " << setw(14) << iter->first << " = ";
302-
if (description.length()) {
302+
if (!description.empty()) {
303303
cout << setw(14) << ""
304304
<< " - " << description;
305305
}
@@ -601,7 +601,7 @@ void CommandLineParser::_finishDefaultOptions(std::string tag) {
601601
// Store lfn to pfn //
602602
//////////////////////
603603
const string &kStorePrepend = stringValue("storePrepend");
604-
if (kStorePrepend.length()) {
604+
if (!kStorePrepend.empty()) {
605605
string match = "/store/";
606606
int matchLen = match.length();
607607
SVec tempVec;
@@ -623,7 +623,7 @@ void CommandLineParser::_finishDefaultOptions(std::string tag) {
623623
// //////////////////////////// //
624624
//////////////////////////////////
625625
string outputFile = stringValue("outputFile");
626-
bool modifyOutputFile = (outputFile.length());
626+
bool modifyOutputFile = (!outputFile.empty());
627627
outputFile = removeEnding(outputFile, ".root");
628628
outputFile += tag;
629629
if (integerValue("maxEvents")) {
@@ -632,7 +632,7 @@ void CommandLineParser::_finishDefaultOptions(std::string tag) {
632632
if (integerValue("jobID") >= 0) {
633633
outputFile += Form("_jobID%03d", integerValue("jobID"));
634634
}
635-
if (stringValue("tag").length()) {
635+
if (!stringValue("tag").empty()) {
636636
outputFile += "_" + stringValue("tag");
637637
}
638638

PhysicsTools/FWLite/src/TH1Store.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ void TH1Store::add(TH1 *histPtr, const std::string &directory) {
4040
}
4141
m_ptrMap[name] = histPtr;
4242
histPtr->SetDirectory(nullptr);
43-
if (directory.length()) {
43+
if (!directory.empty()) {
4444
m_nameDirMap[name] = directory;
4545
}
4646
}

0 commit comments

Comments
 (0)