summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorPavel Solodovnikov <hellyeahdominate@gmail.com>2017-09-15 23:26:49 (GMT)
committerPavel Solodovnikov <hellyeahdominate@gmail.com>2017-09-15 23:26:49 (GMT)
commit5db3aac11177e3487544d02beecbaddb500d4c65 (patch)
treed830a38f27f27366405cf948c9c5919564beac9b /Source/cmFileCommand.cxx
parentc0c5f924fe46fcf83603117689b372cb8520c4bb (diff)
downloadCMake-5db3aac11177e3487544d02beecbaddb500d4c65.zip
CMake-5db3aac11177e3487544d02beecbaddb500d4c65.tar.gz
CMake-5db3aac11177e3487544d02beecbaddb500d4c65.tar.bz2
Meta: replace empty-string assignments with `clear()`.
Diffstat (limited to 'Source/cmFileCommand.cxx')
-rw-r--r--Source/cmFileCommand.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 4eb74cc..6a2db29 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -656,7 +656,7 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
c = current_str[current_str.size() - 1 - j];
fin.putback(static_cast<char>(c));
}
- current_str = "";
+ current_str.clear();
}
}
@@ -667,14 +667,14 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
if (s.length() >= minlen && (!have_regex || regex.find(s.c_str()))) {
output_size += static_cast<int>(s.size()) + 1;
if (limit_output >= 0 && output_size >= limit_output) {
- s = "";
+ s.clear();
break;
}
strings.push_back(s);
}
// Reset the string to empty.
- s = "";
+ s.clear();
} else if (current_str.empty()) {
// A non-string character has been found. Check if the current
// string matches the requirements. We require that the length
@@ -683,14 +683,14 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
(!have_regex || regex.find(s.c_str()))) {
output_size += static_cast<int>(s.size()) + 1;
if (limit_output >= 0 && output_size >= limit_output) {
- s = "";
+ s.clear();
break;
}
strings.push_back(s);
}
// Reset the string to empty.
- s = "";
+ s.clear();
} else {
s += current_str;
}
@@ -700,12 +700,12 @@ bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
if (s.length() >= minlen && (!have_regex || regex.find(s.c_str()))) {
output_size += static_cast<int>(s.size()) + 1;
if (limit_output >= 0 && output_size >= limit_output) {
- s = "";
+ s.clear();
break;
}
strings.push_back(s);
}
- s = "";
+ s.clear();
}
}