internal Range FindRecords<TKey, TRow>(ComparisonBySelector<TKey, TRow> comparison, TKey key) where TRow: DataRow { int root = this.records.root; while (root != 0) { int num2 = comparison(key, (TRow) this.table.recordManager[this.records.Key(root)]); if (num2 == 0) { break; } if (num2 < 0) { root = this.records.Left(root); } else { root = this.records.Right(root); } } return this.GetRangeFromNode(root); }
/// <summary>This method exists for LinqDataView to keep a level of abstraction away from the RBTree</summary> internal Range FindRecords <TKey, TRow>(ComparisonBySelector <TKey, TRow> comparison, TKey key) where TRow : DataRow { int x = records.root; while (IndexTree.NIL != x) { int c = comparison(key, (TRow)table.recordManager[records.Key(x)]); if (c == 0) { break; } if (c < 0) { x = records.Left(x); } else { x = records.Right(x); } } return(GetRangeFromNode(x)); }