Gui: modernize C++: use range-based for loop
This commit is contained in:
@@ -54,8 +54,8 @@ WorkbenchManager::WorkbenchManager() : _activeWorkbench(nullptr)
|
||||
|
||||
WorkbenchManager::~WorkbenchManager()
|
||||
{
|
||||
for (std::map<std::string, Workbench*>::iterator it = _workbenches.begin(); it != _workbenches.end(); ++it) {
|
||||
Workbench* wb = it->second;
|
||||
for (auto & it : _workbenches) {
|
||||
Workbench* wb = it.second;
|
||||
delete wb;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ Workbench* WorkbenchManager::active() const
|
||||
std::list<std::string> WorkbenchManager::workbenches() const
|
||||
{
|
||||
std::list<std::string> wb;
|
||||
for (std::map<std::string, Workbench*>::const_iterator it = _workbenches.begin(); it != _workbenches.end(); ++it)
|
||||
wb.push_back(it->first);
|
||||
for (const auto & it : _workbenches)
|
||||
wb.push_back(it.first);
|
||||
return wb;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user