public override void TrimInstanceSet(int maxSize, FilterInfo owner) { int count = base.Count; int num = count; if (count > maxSize) { if (0 < maxSize) { for (num = maxSize; num < count && base.m_comparer.Compare(base.m_keys[num - 1], base.m_keys[num]) == 0; num++) { } for (int i = num; i < count; i++) { owner.Remove((DataInstanceInfo)base.m_values[i]); } base.m_keys.RemoveRange(num, count - num); base.m_values.RemoveRange(num, count - num); } else { owner.RemoveAll(); base.m_keys = null; base.m_values = null; } } }
internal override void TrimInstanceSet(int maxSize, FilterInfo owner) { int count = base.Count; int num = count; if (count <= maxSize) { return; } if (0 < maxSize) { for (num = maxSize; num < count && m_comparer.Compare(m_keys[num - 1], m_keys[num]) == 0; num++) { } for (int i = num; i < count; i++) { owner.Remove((DataInstanceInfo)m_values[i]); } m_keys.RemoveRange(num, count - num); m_values.RemoveRange(num, count - num); } else { owner.RemoveAll(); m_keys = null; m_values = null; } }
public override bool Add(object key, object value, FilterInfo owner) { if (base.m_keys == null) { base.m_keys = new ArrayList(Math.Min(1000, this.m_maxSize)); base.m_values = new ArrayList(Math.Min(1000, this.m_maxSize)); } int num; try { num = base.Search(key); } catch { throw new ReportProcessingException(base.m_filters.RegisterComparisonError()); } int count = base.m_keys.Count; bool flag = false; if (count < this.m_maxSize) { flag = true; } else if (num < count) { flag = true; if (num < this.m_maxSize) { int num2 = this.m_maxSize - 1; object y = (num != this.m_maxSize - 1) ? base.m_keys[num2 - 1] : key; int num3; try { num3 = base.m_comparer.Compare(base.m_keys[num2], y); } catch { throw new ReportProcessingException(base.m_filters.RegisterComparisonError()); } if (num3 != 0) { for (int i = num2; i < count; i++) { owner.Remove((DataInstanceInfo)base.m_values[i]); } base.m_keys.RemoveRange(num2, count - num2); base.m_values.RemoveRange(num2, count - num2); } } } else if (count > 0) { try { if (base.m_comparer.Compare(base.m_keys[count - 1], key) == 0) { flag = true; } } catch { throw new ReportProcessingException(base.m_filters.RegisterComparisonError()); } } if (flag) { base.m_keys.Insert(num, key); base.m_values.Insert(num, value); } return(flag); }