浏览代码

cmNinjaTargetGenerator: Reduce string copies in ConvertToNinjaPath wrapper

The global generator's method returns a reference to a cached value.
Return that from the wrapper too.
Brad King 4 年之前
父节点
当前提交
efb8d7b4a1
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Source/cmNinjaTargetGenerator.h

+ 1 - 1
Source/cmNinjaTargetGenerator.h

@@ -101,7 +101,7 @@ protected:
                               const std::string& language,
                               const std::string& language,
                               const std::string& config);
                               const std::string& config);
 
 
-  std::string ConvertToNinjaPath(const std::string& path) const
+  std::string const& ConvertToNinjaPath(const std::string& path) const
   {
   {
     return this->GetGlobalGenerator()->ConvertToNinjaPath(path);
     return this->GetGlobalGenerator()->ConvertToNinjaPath(path);
   }
   }