예제 #1
0
 protected bool EqualsSegment(ItemSegment other)
 {
     if (other == null)
     {
         return(false);
     }
     else if (ReferenceEquals(other, this))
     {
         return(true);
     }
     else if (other._hash != _hash)
     {
         return(false);
     }
     else if (!Type.Equals(other.Type))
     {
         return(false);
     }
     else if (Values.Length != other.Values.Length)
     {
         return(false);
     }
     else
     {
         for (int i = 0; i < CasedValues.Length; i++)
         {
             if (CasedValues[i] != other.CasedValues[i])
             {
                 return(false);
             }
         }
         return(true);
     }
 }
예제 #2
0
 public string GetValue(ItemSegment item, int i)
 {
     // Slightly optimized for equal types of item and Match
     return(item.Type.Equals(this) || _matchesOnFieldNr || item.Type._matchesOnFieldNr
         ? item.Values[i]
         : GetValueRetrievers(item.Type)[i](item));
 }