From 169dff19d4da8d76e69b8e896aa25b0013639c03 Mon Sep 17 00:00:00 2001 From: Marc Jeanmougin Date: Wed, 2 Jan 2019 10:41:30 +0100 Subject: modernize loops --- src/util/units.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/util/units.cpp') diff --git a/src/util/units.cpp b/src/util/units.cpp index 8c0be134d..0a1fdbf31 100644 --- a/src/util/units.cpp +++ b/src/util/units.cpp @@ -267,9 +267,9 @@ UnitTable::UnitTable() UnitTable::~UnitTable() { - for (UnitCodeMap::iterator iter = _unit_map.begin(); iter != _unit_map.end(); ++iter) + for (auto & iter : _unit_map) { - delete iter->second; + delete iter.second; } } @@ -383,9 +383,9 @@ bool UnitTable::hasUnit(Glib::ustring const &unit) const UnitTable::UnitMap UnitTable::units(UnitType type) const { UnitMap submap; - for (UnitCodeMap::const_iterator iter = _unit_map.begin(); iter != _unit_map.end(); ++iter) { - if (iter->second->type == type) { - submap.insert(UnitMap::value_type(iter->second->abbr, *iter->second)); + for (auto iter : _unit_map) { + if (iter.second->type == type) { + submap.insert(UnitMap::value_type(iter.second->abbr, *iter.second)); } } -- cgit v1.2.3