diff --git a/Plugins/AssetUsageDetector/Editor/Utilities.cs b/Plugins/AssetUsageDetector/Editor/Utilities.cs index f1c6661..141bc31 100644 --- a/Plugins/AssetUsageDetector/Editor/Utilities.cs +++ b/Plugins/AssetUsageDetector/Editor/Utilities.cs @@ -471,7 +471,7 @@ namespace AssetUsageDetectorNamespace for( int i = 0; i < objectsToSearch.Count; i++ ) { - if( objectsToSearch[i].obj != null && !objectsToSearch[i].obj.Equals( null ) ) + if( objectsToSearch[i].obj != null ) return false; } @@ -479,38 +479,20 @@ namespace AssetUsageDetectorNamespace } // Check if all the objects inside the list are null - public static bool IsEmpty( this List objects ) + public static bool IsEmpty( this List objects ) where T : Object { if( objects == null ) return true; for( int i = 0; i < objects.Count; i++ ) { - if( objects[i] != null && !objects[i].Equals( null ) ) + if( objects[i] != null ) return false; } return true; } - // Check if all the objects that are enumerated are null - public static bool IsEmpty( this IEnumerable objects ) - { - if( objects == null ) - return true; - - using( IEnumerator enumerator = objects.GetEnumerator() ) - { - while( enumerator.MoveNext() ) - { - if( enumerator.Current != null && !enumerator.Current.Equals( null ) ) - return false; - } - } - - return true; - } - // Returns true is str starts with prefix public static bool StartsWithFast( this string str, string prefix ) {