Преглед изворни кода

Replace loop with member algorithm.

Stephen Kelly пре 10 година
родитељ
комит
6cd2ee9524
1 измењених фајлова са 5 додато и 6 уклоњено
  1. 5 6
      Source/cmLocalGenerator.cxx

+ 5 - 6
Source/cmLocalGenerator.cxx

@@ -3642,14 +3642,13 @@ bool cmLocalGenerator::CheckDefinition(std::string const& define) const
 {
   // Many compilers do not support -DNAME(arg)=sdf so we disable it.
   bool function_style = false;
-  for(const char* c = define.c_str(); *c && *c != '='; ++c)
+
+  std::string::size_type pos = define.find_first_of("(=");
+  if (pos != std::string::npos)
     {
-    if(*c == '(')
-      {
-      function_style = true;
-      break;
-      }
+    function_style = define[pos] == '(';
     }
+
   if(function_style)
     {
     std::ostringstream e;