FreeRecord() private method

private FreeRecord ( int record ) : void
record int
return void
Ejemplo n.º 1
0
 internal void Clear(bool clearAll)
 {
     if (clearAll)
     {
         for (int record = 0; record < recordCapacity; ++record)
         {
             rows[record] = null;
         }
         int count = table.columnCollection.Count;
         for (int i = 0; i < count; ++i)
         {
             // SQLBU 415729: Serious performance issue when calling Clear()
             // this improves performance by caching the column instead of obtaining it for each row
             DataColumn column = table.columnCollection[i];
             for (int record = 0; record < recordCapacity; ++record)
             {
                 column.FreeRecord(record);
             }
         }
         lastFreeRecord = 0;
         freeRecordList.Clear();
     }
     else   // just clear attached rows
     {
         freeRecordList.Capacity = freeRecordList.Count + table.Rows.Count;
         for (int record = 0; record < recordCapacity; ++record)
         {
             if (rows[record] != null && rows[record].rowID != -1)
             {
                 int tempRecord = record;
                 FreeRecord(ref tempRecord);
             }
         }
     }
 }
Ejemplo n.º 2
0
 internal void Clear(bool clearAll)
 {
     if (clearAll)
     {
         for (int record = 0; record < _recordCapacity; ++record)
         {
             _rows[record] = null;
         }
         int count = _table._columnCollection.Count;
         for (int i = 0; i < count; ++i)
         {
             // this improves performance by caching the column instead of obtaining it for each row
             DataColumn column = _table._columnCollection[i];
             for (int record = 0; record < _recordCapacity; ++record)
             {
                 column.FreeRecord(record);
             }
         }
         _lastFreeRecord = 0;
         _freeRecordList.Clear();
     }
     else
     { // just clear attached rows
         _freeRecordList.Capacity = _freeRecordList.Count + _table.Rows.Count;
         for (int record = 0; record < _recordCapacity; ++record)
         {
             if (_rows[record] != null && _rows[record].rowID != -1)
             {
                 int tempRecord = record;
                 FreeRecord(ref tempRecord);
             }
         }
     }
 }
 internal void Clear(bool clearAll)
 {
     if (clearAll)
     {
         for (int i = 0; i < this.recordCapacity; i++)
         {
             this.rows[i] = null;
         }
         int count = this.table.columnCollection.Count;
         for (int j = 0; j < count; j++)
         {
             DataColumn column = this.table.columnCollection[j];
             for (int k = 0; k < this.recordCapacity; k++)
             {
                 column.FreeRecord(k);
             }
         }
         this.lastFreeRecord = 0;
         this.freeRecordList.Clear();
     }
     else
     {
         this.freeRecordList.Capacity = this.freeRecordList.Count + this.table.Rows.Count;
         for (int m = 0; m < this.recordCapacity; m++)
         {
             if ((this.rows[m] != null) && (this.rows[m].rowID != -1L))
             {
                 int record = m;
                 this.FreeRecord(ref record);
             }
         }
     }
 }