فهرست منبع

Merge pull request #4008 from krishty/no-empty-string-literals

style fix – initializing and assigning empty std::string properly
Kim Kulling 4 سال پیش
والد
کامیت
843e16868c
2فایلهای تغییر یافته به همراه3 افزوده شده و 3 حذف شده
  1. 2 2
      code/AssetLib/STEPParser/STEPFileReader.cpp
  2. 1 1
      code/AssetLib/glTF/glTFCommon.h

+ 2 - 2
code/AssetLib/STEPParser/STEPFileReader.cpp

@@ -58,13 +58,13 @@ using namespace Assimp;
 namespace EXPRESS = STEP::EXPRESS;
 namespace EXPRESS = STEP::EXPRESS;
 
 
 // ------------------------------------------------------------------------------------------------
 // ------------------------------------------------------------------------------------------------
-std::string AddLineNumber(const std::string& s,uint64_t line /*= LINE_NOT_SPECIFIED*/, const std::string& prefix = "")
+std::string AddLineNumber(const std::string& s,uint64_t line /*= LINE_NOT_SPECIFIED*/, const std::string& prefix = std::string())
 {
 {
     return line == STEP::SyntaxError::LINE_NOT_SPECIFIED ? prefix+s : static_cast<std::string>( (Formatter::format(),prefix,"(line ",line,") ",s) );
     return line == STEP::SyntaxError::LINE_NOT_SPECIFIED ? prefix+s : static_cast<std::string>( (Formatter::format(),prefix,"(line ",line,") ",s) );
 }
 }
 
 
 // ------------------------------------------------------------------------------------------------
 // ------------------------------------------------------------------------------------------------
-std::string AddEntityID(const std::string& s,uint64_t entity /*= ENTITY_NOT_SPECIFIED*/, const std::string& prefix = "")
+std::string AddEntityID(const std::string& s,uint64_t entity /*= ENTITY_NOT_SPECIFIED*/, const std::string& prefix = std::string())
 {
 {
     return entity == STEP::TypeError::ENTITY_NOT_SPECIFIED ? prefix+s : static_cast<std::string>( (Formatter::format(),prefix,"(entity #",entity,") ",s));
     return entity == STEP::TypeError::ENTITY_NOT_SPECIFIED ? prefix+s : static_cast<std::string>( (Formatter::format(),prefix,"(entity #",entity,") ",s));
 }
 }

+ 1 - 1
code/AssetLib/glTF/glTFCommon.h

@@ -196,7 +196,7 @@ inline std::string getCurrentAssetDir(const std::string &pFile) {
     std::string path = pFile;
     std::string path = pFile;
     int pos = std::max(int(pFile.rfind('/')), int(pFile.rfind('\\')));
     int pos = std::max(int(pFile.rfind('/')), int(pFile.rfind('\\')));
     if (pos == int(std::string::npos)) {
     if (pos == int(std::string::npos)) {
-        return "";
+        return std::string();
     }
     }
 
 
     return pFile.substr(0, pos + 1);
     return pFile.substr(0, pos + 1);