From 2b0323ebc84d155ed5c7c31a22d7604db7a6fa67 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 10 Jul 2020 03:43:23 +0200 Subject: [PATCH] Avoid using wxString::Empty() This is confusingly similar to std::string::empty() which doesn't do the same thing, so prefer using clear() instead. And simply remove Empty() calls before the assignment, as they're useless. No real changes. --- include/wx/dirdlg.h | 6 +++++- src/gtk/dirdlg.cpp | 1 - src/osx/cocoa/dirdlg.mm | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/wx/dirdlg.h b/include/wx/dirdlg.h index 8e1a589ee9..edad929cfe 100644 --- a/include/wx/dirdlg.h +++ b/include/wx/dirdlg.h @@ -94,7 +94,11 @@ public: return m_path; } - virtual void GetPaths(wxArrayString& paths) const { paths.Empty(); paths.Add(m_path); } + virtual void GetPaths(wxArrayString& paths) const + { + paths.clear(); + paths.push_back(m_path); + } protected: wxString m_message; diff --git a/src/gtk/dirdlg.cpp b/src/gtk/dirdlg.cpp index 5aeb52924e..b7246b262e 100644 --- a/src/gtk/dirdlg.cpp +++ b/src/gtk/dirdlg.cpp @@ -196,7 +196,6 @@ wxString wxDirDialog::GetPath() const void wxDirDialog::GetPaths(wxArrayString& paths) const { - paths.Empty(); paths = m_paths; } diff --git a/src/osx/cocoa/dirdlg.mm b/src/osx/cocoa/dirdlg.mm index d526b57774..8e446a8d10 100644 --- a/src/osx/cocoa/dirdlg.mm +++ b/src/osx/cocoa/dirdlg.mm @@ -179,7 +179,6 @@ wxString wxDirDialog::GetPath() const void wxDirDialog::GetPaths(wxArrayString& paths) const { - paths.Empty(); paths = m_paths; }