using System.Collections.Generic;

namespace skyscraper5.Skyscraper.Plugins
{
	internal class ByteArrayComparer : IComparer<byte[]>
	{
		public int Compare(byte[] x, byte[] y)
		{
			int lResult = x.Length.CompareTo(y.Length);
			if (lResult != 0)
				return lResult;

			for (int i = 0; i < x.Length; i++)
			{
				int cResult = x[i].CompareTo(y[i]);
				if (cResult != 0)
					return cResult;
			}

			return 0;
		}
	}
}
