SIL.FieldWorks.Common.Framework.DetailControls.ListHashCodeProvider.IEqualityComparer C# (CSharp) Méthode

IEqualityComparer() private méthode

This comparer is only suitable for hash tables; it doesn't provide a valid (commutative) ordering of items.
Note that in general, boxed values are not equal, even if the unboxed values would be. The current code makes a special case for ints, which behave as expected. This used to be class ListComparer
private IEqualityComparer ( object xArg, object yArg ) : bool
xArg object The x arg.
yArg object The y arg.
Résultat bool
		bool IEqualityComparer.Equals(object xArg, object yArg)
		{
			IList listX = (IList)xArg;
			IList listY = (IList)yArg;
			if (listX.Count != listY.Count)
				return false;
			for (int i = 0; i < listX.Count; i++)
			{
				object x = listX[i];
				object y = listY[i];
				if (x != y && !(x is int && y is int && ((int)x) == ((int)y)))
					return false;
			}
			return true;
		}
	}

Same methods

ListHashCodeProvider::IEqualityComparer ( object objList ) : int
ListHashCodeProvider