Parcourir la source

Remove unused default parameter, avoid StringArray copy on return

Josh Engebretson il y a 9 ans
Parent
commit
0cf8b47fb5

+ 3 - 3
Source/Atomic/Resource/Configuration.cpp

@@ -62,9 +62,9 @@ namespace Atomic
         return value;
     }
 
-    StringVector Configuration::GetArrayValue(const JSONArray & jarray, const StringVector & defaultValue)
+    void Configuration::GetArrayValue(const JSONArray & jarray, StringVector& value)
     {
-        StringVector value;
+        value.Clear();
 
         for (JSONArray::ConstIterator it = jarray.Begin(); it != jarray.End(); it++)
         {
@@ -73,7 +73,7 @@ namespace Atomic
                 value.Push(it->GetString());
             }
         }
-        return value;
+
     }
 
     Configuration::Configuration() :

+ 2 - 5
Source/Atomic/Resource/Configuration.h

@@ -51,8 +51,8 @@ protected:
     static bool GetBoolValue(const JSONValue& jvalue, bool defaultValue);
     static int GetIntValue(const JSONValue& jvalue, int defaultValue);
     static String GetStringValue(const JSONValue& jvalue, const String& defaultValue);
-    static StringVector GetArrayValue(const JSONArray& jarray, const StringVector& defaultValue);
-    
+    static void GetArrayValue(const JSONArray& jarray, StringVector& value);
+
     virtual bool LoadDesktopConfig(JSONValue root) { return true; };
 
     VariantMap valueMap_;
@@ -62,6 +62,3 @@ private:
     bool isLoaded_;
 };
 }
-
-
-

+ 4 - 3
Source/ToolCore/Build/AssetBuildConfig.cpp

@@ -45,8 +45,9 @@ namespace Atomic
 
             const JSONArray& resources = resourceTag["Resources"]->GetArray();
 
-            Vector<String> empty;
-            valueMap_[tag.CString()] = GetArrayValue(resources, empty);
+            StringVector value;
+            GetArrayValue(resources, value);
+            valueMap_[tag.CString()] = value;
         }
 
         return true;
@@ -67,4 +68,4 @@ namespace Atomic
         return true;
     }
 
-}
+}