Created
June 30, 2015 09:40
-
-
Save keijiro/82028359be65e3f3b088 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections.Generic; | |
public class Test : MonoBehaviour | |
{ | |
void Start() | |
{ | |
int?[] array1 = { null, null }; | |
int?[] array2 = { null, null }; | |
bool result = array1.ObjectEquals(array2); | |
Debug.Log("Result:" + result); | |
} | |
} | |
public static class IEnumerableExtensions | |
{ | |
public static bool ObjectEquals<T>(this IEnumerable<T> e1, IEnumerable<T> e2) | |
{ | |
var n1 = e1.GetEnumerator(); | |
var n2 = e2.GetEnumerator(); | |
while (n1.MoveNext()) | |
{ | |
n2.MoveNext(); | |
if (!n1.Current.Equals(n2.Current)) return false; | |
} | |
return true; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment