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); } }
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)); }