protected bool EqualsSegment(ItemSegment other) { if (other == null) { return(false); } else { if (!Type.Equals(other.Type)) { return(false); } if (Values.Length != other.Values.Length) { return(false); } 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)); }