code optimization in HistoryDlg::displayResult