From 21e96c692595f204b91431a90123419e4a1780c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Fri, 22 Jul 2022 23:52:22 +0200 Subject: Cache GetSystemMetrics values with variable template. The variable template could be generalized like this: template const auto cache = F(A...); and instantiated like: cache It would still be limited to constant function arguments, which usually isn't a problem for GetSystemMetrics, but might be for other functions. --- c/datalistview.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'c/datalistview.cpp') diff --git a/c/datalistview.cpp b/c/datalistview.cpp index c191901..9ff4659 100644 --- a/c/datalistview.cpp +++ b/c/datalistview.cpp @@ -31,12 +31,11 @@ DataListView::DataListView(const HWND hWndParent) void DataListView::ResizeColumns(RECT& rcParent) { - extern int g_cxVScroll; ListView_SetColumnWidth(hWnd, DLVSIKEY, LVSCW_AUTOSIZE); const int cxColumn = ListView_GetColumnWidth(hWnd, 0)+4; ListView_SetColumnWidth(hWnd, DLVSIKEY, cxColumn); - ListView_SetColumnWidth(hWnd, DLVSIVALUE, rcParent.right-cxColumn-g_cxVScroll-4); + ListView_SetColumnWidth(hWnd, DLVSIVALUE, rcParent.right-cxColumn-Metric-4); } void DataListView::ShowEpisode(const int iEpisode) -- cgit v1.2.3