System.Data.Common.DBConnectionString.RemoveDuplicates C# (CSharp) Method

RemoveDuplicates() static private method

static private RemoveDuplicates ( string restrictions ) : string[]
restrictions string
return string[]
        internal static string[] RemoveDuplicates(string[] restrictions)
        {
            int count = restrictions.Length;
            if (0 < count)
            {
                Array.Sort(restrictions, StringComparer.Ordinal);

                for (int i = 1; i < restrictions.Length; ++i)
                {
                    string prev = restrictions[i - 1];
                    if ((0 == prev.Length) || (prev == restrictions[i]))
                    {
                        restrictions[i - 1] = null;
                        count--;
                    }
                }
                if (0 == restrictions[restrictions.Length - 1].Length)
                {
                    restrictions[restrictions.Length - 1] = null;
                    count--;
                }
                if (count != restrictions.Length)
                {
                    string[] tmp = new string[count];
                    count = 0;
                    for (int i = 0; i < restrictions.Length; ++i)
                    {
                        if (null != restrictions[i])
                        {
                            tmp[count++] = restrictions[i];
                        }
                    }
                    restrictions = tmp;
                }
            }
            Verify(restrictions);
            return restrictions;
        }