コード例 #1
0
        /// <summary>
        /// Returns true if the given parameter name appears more than one on the list of arguments.
        /// </summary>
        public static bool IsArgumentDuplicated(SimpleList <Pair <string, string> > arguments, string parameterName)
        {
            var set = SSet.Create <string>(10, true);

            SSet.Clear(set);
            for (int i = 0; i < arguments.Count; i++)
            {
                var key = arguments[i].Key;
                if (string.Equals(key, parameterName, StringComparison.InvariantCultureIgnoreCase))
                {
                    if (SSet.Contains(set, key))
                    {
                        return(true);
                    }
                    else
                    {
                        SSet.Add(set, key);
                    }
                }
            }

            return(false);
        }