Gui: Use auto and range-based for (#7481)

* On lines where the variable type is obvious from inspection, avoid repeating the type using auto. 
* When possible use a ranged for loop instead of begin() and end() iterators
This commit is contained in:
berniev
2022-09-15 04:25:13 +10:00
committed by GitHub
parent f7c84dfd09
commit ae53c9b0a4
175 changed files with 2051 additions and 2057 deletions

View File

@@ -83,8 +83,8 @@ PyObject* WorkbenchPy::listMenus(PyObject *args)
std::list<std::string> menus = getWorkbenchPtr()->listMenus();
Py::List list;
for (std::list<std::string>::iterator it = menus.begin(); it != menus.end(); ++it) {
list.append(Py::String(*it));
for (const auto & menu : menus) {
list.append(Py::String(menu));
}
return Py::new_reference_to(list);
} PY_CATCH;
@@ -100,8 +100,8 @@ PyObject* WorkbenchPy::listToolbars(PyObject *args)
std::list<std::string> bars = getWorkbenchPtr()->listToolbars();
Py::List list;
for (std::list<std::string>::iterator it = bars.begin(); it != bars.end(); ++it) {
list.append(Py::String(*it));
for (const auto & bar : bars) {
list.append(Py::String(bar));
}
return Py::new_reference_to(list);
} PY_CATCH;
@@ -138,8 +138,8 @@ PyObject* WorkbenchPy::listCommandbars(PyObject *args)
std::list<std::string> bars = getWorkbenchPtr()->listCommandbars();
Py::List list;
for (std::list<std::string>::iterator it = bars.begin(); it != bars.end(); ++it) {
list.append(Py::String(*it));
for (const auto & bar : bars) {
list.append(Py::String(bar));
}
return Py::new_reference_to(list);
} PY_CATCH;