From 88eb5e8b57bcaf8a45df6dd86e4d574ef86be521 Mon Sep 17 00:00:00 2001 From: Ansgar Becker Date: Sun, 14 Jun 2009 20:03:09 +0000 Subject: [PATCH] Minor optimization in TMainForm.LoadDatabaseProperties --- source/main.pas | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/source/main.pas b/source/main.pas index e80e6d91..ac65cbf0 100644 --- a/source/main.pas +++ b/source/main.pas @@ -3888,7 +3888,7 @@ end; procedure TMainForm.LoadDatabaseProperties(db: WideString); var - i : Integer; + i, img : Integer; bytes : Int64; ds : TDataSet; Cap, @@ -3953,23 +3953,14 @@ begin VTRowDataListTables[i-1].NodeType := GetDBObjectType( ds.Fields); // Find icon case VTRowDataListTables[i-1].NodeType of - lntTable, lntCrashedTable: // A normal table - begin - if GetDBObjectType(ds.Fields) = lntCrashedTable then - VTRowDataListTables[i-1].ImageIndex := ICONINDEX_CRASHED_TABLE - else - VTRowDataListTables[i-1].ImageIndex := ICONINDEX_TABLE; - end; - - lntView: - VTRowDataListTables[i-1].ImageIndex := ICONINDEX_VIEW; - - lntProcedure: - VTRowDataListTables[i-1].ImageIndex := ICONINDEX_STOREDPROCEDURE; - - lntFunction: - VTRowDataListTables[i-1].ImageIndex := ICONINDEX_STOREDFUNCTION; + lntTable: img := ICONINDEX_TABLE; + lntCrashedTable: img := ICONINDEX_CRASHED_TABLE; + lntView: img := ICONINDEX_VIEW; + lntProcedure: img := ICONINDEX_STOREDPROCEDURE; + lntFunction: img := ICONINDEX_STOREDFUNCTION; + else img := -1; end; + VTRowDataListTables[i-1].ImageIndex := img; ds.Next; end;