Bump corefx
[mono.git] / mcs / class / System.Data / corefx / Index.cs
1 namespace System.Data
2 {
3         partial class Index
4         {
5                 internal delegate int ComparisonBySelector<TKey,TRow>(TKey key, TRow row) where TRow:DataRow;
6
7                 /// <summary>This method exists for LinqDataView to keep a level of abstraction away from the RBTree</summary>
8                 internal Range FindRecords<TKey,TRow>(ComparisonBySelector<TKey,TRow> comparison, TKey key) where TRow:DataRow
9                 {
10                         int x = _records.root;
11                         while (IndexTree.NIL != x)
12                         {
13                                 int c = comparison(key, (TRow)_table._recordManager[_records.Key(x)]);
14                                 if (c == 0) { break; }
15                                 if (c < 0) { x = _records.Left(x); }
16                                 else { x = _records.Right(x); }
17                         }
18                         return GetRangeFromNode(x);
19                 }
20         }
21 }