Browse Source

Convert more loops to range-based for-loops

Vitaly Stakhovsky 5 năm trước cách đây
mục cha
commit
cbbca9ee2a
2 tập tin đã thay đổi với 5 bổ sung6 xóa
  1. 3 3
      Source/cmLocalGenerator.cxx
  2. 2 3
      Source/cmLocalVisualStudio7Generator.cxx

+ 3 - 3
Source/cmLocalGenerator.cxx

@@ -2914,11 +2914,11 @@ void cmLocalGenerator::JoinDefines(const std::set<std::string>& defines,
       // command line without any escapes.  However we still have to
       // get the '$' and '#' characters through WMake as '$$' and
       // '$#'.
-      for (const char* c = define.c_str(); *c; ++c) {
-        if (*c == '$' || *c == '#') {
+      for (char c : define) {
+        if (c == '$' || c == '#') {
           def += '$';
         }
-        def += *c;
+        def += c;
       }
     } else {
       // Make the definition appear properly on the command line.  Use

+ 2 - 3
Source/cmLocalVisualStudio7Generator.cxx

@@ -1510,10 +1510,9 @@ cmLocalVisualStudio7GeneratorFCInfo::cmLocalVisualStudio7GeneratorFCInfo(
     if (const char* deps = sf.GetProperty("OBJECT_DEPENDS")) {
       std::vector<std::string> depends = cmExpandedList(deps);
       const char* sep = "";
-      for (std::vector<std::string>::iterator j = depends.begin();
-           j != depends.end(); ++j) {
+      for (const std::string& d : depends) {
         fc.AdditionalDeps += sep;
-        fc.AdditionalDeps += lg->ConvertToXMLOutputPath(*j);
+        fc.AdditionalDeps += lg->ConvertToXMLOutputPath(d);
         sep = ";";
         needfc = true;
       }