summaryrefslogtreecommitdiffstats
path: root/Source/cmFileCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-19 12:26:30 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-09-19 12:27:00 (GMT)
commit7c28081c147e2eb6c7ad6dee0aada77219af7a6d (patch)
tree92f007052e873070f18bd07f7b24a42bdc1160cc /Source/cmFileCommand.cxx
parent8fee054ecaf039d4253a2e9cfeafb3c154704808 (diff)
parent5db3aac11177e3487544d02beecbaddb500d4c65 (diff)
downloadCMake-7c28081c147e2eb6c7ad6dee0aada77219af7a6d.zip
CMake-7c28081c147e2eb6c7ad6dee0aada77219af7a6d.tar.gz
CMake-7c28081c147e2eb6c7ad6dee0aada77219af7a6d.tar.bz2
Merge topic 'string-clear'
5db3aac1 Meta: replace empty-string assignments with `clear()`. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1276
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 35ebb47..98c5733 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();
}
}