From b83178086d6cc0ca26e91485566a0f67c153e986 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 9 Oct 2022 23:47:36 +0200 Subject: [PATCH] Use wxVector::shrink_to_fit() directly Don't use deprecated wxShrinkToFit() as now wxVector always has this member function because it is available even in STL build when using C++11. --- include/wx/dynarray.h | 6 +----- src/generic/listctrl.cpp | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/wx/dynarray.h b/include/wx/dynarray.h index 9317776aac..f412c12197 100644 --- a/include/wx/dynarray.h +++ b/include/wx/dynarray.h @@ -108,11 +108,7 @@ public: void Empty() { this->clear(); } void Clear() { this->clear(); } void Alloc(size_t uiSize) { this->reserve(uiSize); } - - void Shrink() - { - wxShrinkToFit(*this); - } + void Shrink() { this->shrink_to_fit(); } size_t GetCount() const { return this->size(); } void SetCount(size_t n, T v = T()) { this->resize(n, v); } diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 401f32cc00..1db9b9b7b7 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -1728,7 +1728,7 @@ wxListLineData *wxListMainWindow::GetDummyLine() const // don't waste extra memory -- there never going to be anything // else/more in this array - wxShrinkToFit(self->m_lines); + self->m_lines.shrink_to_fit(); } return m_lines[0];