Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SelectRows()

DataRow[] System.Data.Select.SelectRows ( )
inline

Definition at line 488 of file Select.cs.

489 {
490 bool flag = true;
492 if (_expression is BinaryNode)
493 {
494 AnalyzeExpression((BinaryNode)_expression);
496 {
498 }
500 {
501 for (int i = 0; i < _candidateColumns.Length; i++)
502 {
503 if (_candidateColumns[i] != null)
504 {
506 _candidateColumns[i].expr = null;
507 }
508 }
509 }
510 else
511 {
513 }
514 }
515 else
516 {
518 }
519 if (_index == null && (_indexFields.Length != 0 || _linearExpression == _expression))
520 {
521 flag = !FindSortIndex();
522 }
523 if (_index == null)
524 {
525 CreateIndex();
526 flag = false;
527 }
528 if (_index.RecordCount == 0)
529 {
530 return _table.NewRowArray(0);
531 }
532 Range range;
533 if (_matchedCandidates == 0)
534 {
535 range = new Range(0, _index.RecordCount - 1);
538 }
540 if (range.Count == 0)
541 {
542 return _table.NewRowArray(0);
543 }
545 {
547 }
548 if (!flag)
549 {
551 }
553 _recordCount = _records.Length;
554 if (_recordCount == 0)
555 {
556 return _table.NewRowArray(0);
557 }
558 Sort(0, _recordCount - 1);
559 return GetRows();
560 }
DataRow[] NewRowArray(int size)
bool _candidatesForBinarySearch
Definition Select.cs:37
bool FindSortIndex()
Definition Select.cs:220
ColumnInfo[] _candidateColumns
Definition Select.cs:39
void AnalyzeExpression(BinaryNode expr)
Definition Select.cs:67
void CreateIndex()
Definition Select.cs:322
void Sort(int left, int right)
Definition Select.cs:868
DataRow[] GetRows()
Definition Select.cs:562
bool FindClosestCandidateIndex()
Definition Select.cs:263
Range GetBinaryFilteredRecords()
Definition Select.cs:766
int _matchedCandidates
Definition Select.cs:43
ExpressionNode _linearExpression
Definition Select.cs:35
readonly DataTable _table
Definition Select.cs:19
int[] GetLinearFilteredRecords(Range range)
Definition Select.cs:781
readonly ExpressionNode _expression
Definition Select.cs:27
void BuildLinearExpression()
Definition Select.cs:457
void InitCandidateColumns()
Definition Select.cs:303
readonly IndexField[] _indexFields
Definition Select.cs:21
DataRow[] GetLinearFilteredRows(Range range)
Definition Select.cs:813

References System.Data.Select._candidateColumns, System.Data.Select._candidatesForBinarySearch, System.Data.Select._expression, System.Data.Select._index, System.Data.Select._indexFields, System.Data.Select._linearExpression, System.Data.Select._matchedCandidates, System.Data.Select._nCandidates, System.Data.Select._recordCount, System.Data.Select._records, System.Data.Select._table, System.Data.Select.AnalyzeExpression(), System.Data.Select.BuildLinearExpression(), System.Collections.Generic.Dictionary< TKey, TValue >.Count, System.Data.Select.CreateIndex(), System.Data.Select.ColumnInfo.equalsOperator, System.Data.Select.ColumnInfo.expr, System.Data.Select.FindClosestCandidateIndex(), System.Data.Select.FindSortIndex(), System.Data.Select.GetBinaryFilteredRecords(), System.Data.Select.GetLinearFilteredRecords(), System.Data.Select.GetLinearFilteredRows(), System.Data.Select.GetRows(), System.Data.Select.InitCandidateColumns(), System.Data.DataTable.NewRowArray(), System.Data.Index.RecordCount, and System.Data.Select.Sort().