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

NoDuplicateUnion() private static method

private static NoDuplicateUnion ( string a, string b ) : string[]
a string
b string
return string[]
        private static string[] NoDuplicateUnion(string[] a, string[] b)
        {
#if DEBUG
            Debug.Assert(null != a && 0 < a.Length, "empty a");
            Debug.Assert(null != b && 0 < b.Length, "empty b");
            Verify(a);
            Verify(b);
#endif
            List<string> newlist = new List<string>(a.Length + b.Length);
            for (int i = 0; i < a.Length; ++i)
            {
                newlist.Add(a[i]);
            }
            for (int i = 0; i < b.Length; ++i)
            { // find duplicates
                if (0 > Array.BinarySearch(a, b[i], StringComparer.Ordinal))
                {
                    newlist.Add(b[i]);
                }
            }
            string[] restrictionValues = newlist.ToArray();
            Array.Sort(restrictionValues, StringComparer.Ordinal);
            Verify(restrictionValues);
            return restrictionValues;
        }