From 01d0deb5bfd576f81f048c4233191ecd9a573fdd Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 31 Jan 2020 16:15:13 +0100 Subject: [PATCH] Get rid of unnecessary variable in wxListCtrl::SetColumnWidth() No real changes, just remove a variable assigned and used exactly once. --- src/generic/listctrl.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index e4ce5b2672..b8acd1b983 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -3279,8 +3279,6 @@ void wxListMainWindow::SetColumnWidth( int col, int width ) wxListHeaderData *column = node->GetData(); - size_t count = GetItemCount(); - if ( width == wxLIST_AUTOSIZE_USEHEADER || width == wxLIST_AUTOSIZE ) { wxListCtrlMaxWidthCalculator calculator(this, col); @@ -3297,7 +3295,8 @@ void wxListMainWindow::SetColumnWidth( int col, int width ) size_t first_visible, last_visible; GetVisibleLinesRange(&first_visible, &last_visible); - calculator.ComputeBestColumnWidth(count, first_visible, last_visible); + calculator.ComputeBestColumnWidth(GetItemCount(), + first_visible, last_visible); pWidthInfo->nMaxWidth = calculator.GetMaxWidth(); pWidthInfo->bNeedsUpdate = false; }