We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4da8c81 commit 6519e5eCopy full SHA for 6519e5e
Assets/JCSUnity/Scripts/Util/JCS_Util.cs
@@ -202,14 +202,18 @@ public static int LoopIn<T>(int index, List<T> arr)
202
/// <returns></returns>
203
public static T[] MergeArrays<T>(params T[][] arrList)
204
{
205
- if (arrList.Length <= 1)
206
- {
207
- JCS_Debug.Log("You trying to merge the array less then two array");
208
- }
+ if (arrList.Length == 0)
+ return null;
+
+ if (arrList.Length == 1)
209
+ return arrList[0];
210
211
int arrLen = 0;
212
213
foreach (var arr in arrList)
214
+ {
215
arrLen += arr.Length;
216
+ }
217
218
// first combine the first two array.
219
T[] data = MergeArrays2<T>(arrList[0], arrList[1]);
0 commit comments