Skip to content

Commit 52126a0

Browse files
committed
Use .contains()
Much more readable.
1 parent 262a127 commit 52126a0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

gui-builder/src/Form.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ void Form::removeWidget(const tgui::String& id)
546546

547547
std::shared_ptr<WidgetInfo> Form::getWidget(const tgui::String& id) const
548548
{
549-
assert(m_widgets.find(id) != m_widgets.end());
549+
assert(m_widgets.contains(id));
550550
return m_widgets.at(id);
551551
}
552552

gui-builder/src/GuiBuilder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ void GuiBuilder::reloadProperties()
772772
if (selectedWidget)
773773
{
774774
// If the widget isn't supported by the Gui Builder (i.e. it was manually placed in the form file), then don't try to create properties
775-
if (m_widgetProperties.find(selectedWidget->ptr->getWidgetType()) == m_widgetProperties.end())
775+
if (!m_widgetProperties.contains(selectedWidget->ptr->getWidgetType()))
776776
{
777777
std::cerr << "Warning: widget of type '" << selectedWidget->ptr->getWidgetType() << "' can't be edited.\n";
778778
return;
@@ -1290,7 +1290,7 @@ void GuiBuilder::createNewWidget(const tgui::Widget::Ptr& widget, tgui::Containe
12901290
bool GuiBuilder::updateWidgetProperty(const tgui::String& property, const tgui::String& value)
12911291
{
12921292
tgui::String oldValue;
1293-
if (m_propertyValuePairs.first.find(property) != m_propertyValuePairs.first.end())
1293+
if (m_propertyValuePairs.first.contains(property))
12941294
oldValue = m_propertyValuePairs.first[property].second;
12951295
else
12961296
oldValue = m_propertyValuePairs.second[property].second;

0 commit comments

Comments
 (0)