style fix - initializing and assigning empty std::string properly

std::string s(""); s = ""; calls the copy constructor, which in turn calls strlen(), … assigning a default-constructed string generates fewer instructions and is therefore preferred.

With C++11 uniform initialization, you’d simply write s = { } instead.
This commit is contained in:
Krishty
2021-04-16 23:43:56 +02:00
parent cd42b9954b
commit f761dc72f4
34 changed files with 48 additions and 48 deletions

View File

@@ -81,7 +81,7 @@ public:
/** @brief Set list of fixed (inmutable) materials
* @param fixed See #AI_CONFIG_PP_RRM_EXCLUDE_LIST
*/
void SetFixedMaterialsString(const std::string& fixed = "") {
void SetFixedMaterialsString(const std::string& fixed = std::string()) {
mConfigFixedMaterials = fixed;
}