Use std::unordered_set<> in wxrc code

Replace a macro-based synonym with the standard container itself.

Also use range for loop for iteration over it.
This commit is contained in:
Vadim Zeitlin 2023-04-17 21:08:28 +01:00
parent aef6ce7605
commit 22acc3f67d

View file

@ -24,11 +24,10 @@
#include "wx/filename.h"
#include "wx/wfstream.h"
#include "wx/utils.h"
#include "wx/hashset.h"
#include "wx/mimetype.h"
#include "wx/vector.h"
WX_DECLARE_HASH_SET(wxString, wxStringHash, wxStringEqual, StringSet);
#include <unordered_set>
class XRCWidgetData
{
@ -51,7 +50,7 @@ class XRCWndClassData
private:
wxString m_className;
wxString m_parentClassName;
StringSet m_ancestorClassNames;
std::unordered_set<wxString> m_ancestorClassNames;
ArrayOfXRCWidgetData m_wdata;
void BrowseXmlNode(wxXmlNode* node)
@ -184,11 +183,9 @@ public:
wxT(" }\n")
wxT("};\n"));
for ( StringSet::const_iterator it = m_ancestorClassNames.begin();
it != m_ancestorClassNames.end();
++it )
for ( const auto& name : m_ancestorClassNames )
{
file.Write(m_className + wxT("(") + *it + wxT(" *parent){\n") +
file.Write(m_className + wxT("(") + name + wxT(" *parent){\n") +
wxT(" InitWidgetsFromXRC((wxWindow *)parent);\n")
wxT(" }\n")
wxT("};\n"));