فهرست منبع

cmLocalGenerator: Replace loop with find_first_not_of

Stephen Kelly 11 سال پیش
والد
کامیت
5fc53f1edb
1فایلهای تغییر یافته به همراه1 افزوده شده و 5 حذف شده
  1. 1 5
      Source/cmLocalGenerator.cxx

+ 1 - 5
Source/cmLocalGenerator.cxx

@@ -3204,11 +3204,7 @@ cmLocalGenerator
     std::string ssin = sin;
 
     // Avoid full paths by removing leading slashes.
-    std::string::size_type pos = 0;
-    for(;pos < ssin.size() && ssin[pos] == '/'; ++pos)
-      {
-      }
-    ssin = ssin.substr(pos);
+    ssin.erase(0, ssin.find_first_not_of("/"));
 
     // Avoid full paths by removing colons.
     cmSystemTools::ReplaceString(ssin, ":", "_");