line 3598-3984: if the table has an available index, the FindRec try to find the record by index, if it can't find the record, it will use the row by row search algorithm -- it is unnecessary, just waste time! if you cann't find it by index, you cann't find it by row-by-row compare too.
if (MTIndex <> nil) and MTIndex.FindRecordIndexByKey(KeyValues, RecIndex) then Result := FRecordsView.IndexOf(FRecordsView.MemTableData.RecordsList[RecIndex]) else begin FieldNo := TField(Fields.First).FieldNo-1; ...//omited end;
it shoult like this:
if (MTIndex <> nil) then begin if MTIndex.FindRecordIndexByKey(KeyValues, RecIndex) then Result := FRecordsView.IndexOf(FRecordsView.MemTableData.RecordsList[RecIndex]); end else begin FieldNo := TField(Fields.First).FieldNo-1; ...//omited end;
|