Beispiel #1
0
 public bool IsSingleConstantArgument(string argumentValue)
 {
     if (m_list.Count == 1)
     {
         ConstantWrapper constantWrapper = m_list[0] as ConstantWrapper;
         if (constantWrapper != null &&
             string.CompareOrdinal(argumentValue, constantWrapper.Value.ToString()) == 0)
         {
             return(true);
         }
     }
     return(false);
 }
Beispiel #2
0
        /// <summary>
        /// Optimized string literal concatenation for repeat usage pattern, avoiding multiple copying and allocation
        /// </summary>
        /// <param name="other"></param>
        /// <returns></returns>
        public StringList Concat(ConstantWrapper other)
        {
            var left = this.Value;

            if (this.PrimitiveType != PrimitiveType.String)
            {
                left = this.ToString();
            }

            object right = null;

            if (other != null)
            {
                right = other.Value;
                if (other.PrimitiveType != PrimitiveType.String)
                {
                    right = other.ToString();
                }
            }

            return(new StringList(left, right));
        }