diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-02-10 22:09:03 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-02-11 21:58:09 (GMT) |
commit | abfca97525be06e067981b6c6bf63ba7a3aa52f9 (patch) | |
tree | 96175eb7cecfdcf89476217804186d54a74f7c00 /Source/cmLocalUnixMakefileGenerator3.cxx | |
parent | 0b61b86df856e3cec366f8c23f35aae576b2d821 (diff) | |
download | CMake-abfca97525be06e067981b6c6bf63ba7a3aa52f9.zip CMake-abfca97525be06e067981b6c6bf63ba7a3aa52f9.tar.gz CMake-abfca97525be06e067981b6c6bf63ba7a3aa52f9.tar.bz2 |
Move loop inside of condition.
The loop is only executed if the condition is true.
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 32da821..703ab27 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -2295,23 +2295,23 @@ cmLocalUnixMakefileGenerator3::ConvertToQuotedOutputPath(const char* p, // Begin the quoted result with the root component. result += components[0]; - // Now add the rest of the components separated by the proper slash - // direction for this platform. - bool first = true; - for(unsigned int i=1; i < components.size() - 1; ++i) + if (components.size() > 1) { - if(!components[i].empty()) + // Now add the rest of the components separated by the proper slash + // direction for this platform. + bool first = true; + for(unsigned int i=1; i < components.size() - 1; ++i) { - if(!first) + if(!components[i].empty()) { - result += slash; + if(!first) + { + result += slash; + } + result += components[i]; + first = false; } - result += components[i]; - first = false; } - } - if (components.size() > 1) - { // Only the last component can be empty to avoid double slashes. if(!first) { |