summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeonid Pospelov <pospelovlm@yandex.ru>2019-04-12 15:24:21 (GMT)
committerLeonid Pospelov <pospelovlm@yandex.ru>2019-04-12 15:24:21 (GMT)
commit3e70a8d0df08301e11fd5c01e623223e434b3d3c (patch)
treea2050ed34faf4139a1c3986f13596d1f5c9b17c8
parente10b04ef055f2c46749e683d13b643c9e2cf32e7 (diff)
downloadCMake-3e70a8d0df08301e11fd5c01e623223e434b3d3c.zip
CMake-3e70a8d0df08301e11fd5c01e623223e434b3d3c.tar.gz
CMake-3e70a8d0df08301e11fd5c01e623223e434b3d3c.tar.bz2
cmVisualStudio10TargetGenerator: Simplify code of two functions
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 80b1add..0cec2fb 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1430,10 +1430,10 @@ std::string cmVisualStudio10TargetGenerator::ConvertPath(
static void ConvertToWindowsSlash(std::string& s)
{
// first convert all of the slashes
- std::string::size_type pos = 0;
- while ((pos = s.find('/', pos)) != std::string::npos) {
- s[pos] = '\\';
- pos++;
+ for (auto& ch : s) {
+ if (ch == '/') {
+ ch = '\\';
+ }
}
}
@@ -4642,10 +4642,8 @@ void cmVisualStudio10TargetGenerator::GetCSharpSourceProperties(
void cmVisualStudio10TargetGenerator::WriteCSharpSourceProperties(
Elem& e2, const std::map<std::string, std::string>& tags)
{
- if (!tags.empty()) {
- for (const auto& i : tags) {
- e2.Element(i.first.c_str(), i.second);
- }
+ for (const auto& i : tags) {
+ e2.Element(i.first.c_str(), i.second);
}
}