Xamarin Public Jenkins (auto-signing) 536cd135cc Imported Upstream version 5.4.0.167
Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
2017-08-21 15:34:15 +00:00

21 lines
659 B
C#

namespace System.Data
{
partial class Index
{
internal delegate int ComparisonBySelector<TKey,TRow>(TKey key, TRow row) where TRow:DataRow;
/// <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);
}
}
}