(svn r26086) -Codechange: use AutoDeleteSmallVector instead std::list for dropdowns

This commit is contained in:
rubidium
2013-11-24 14:46:26 +00:00
parent 6c63c98d7f
commit 201b3d8aa2
15 changed files with 115 additions and 129 deletions

View File

@@ -2590,9 +2590,9 @@ struct IndustryCargoesWindow : public Window {
DropDownList *lst = new DropDownList;
const CargoSpec *cs;
FOR_ALL_SORTED_STANDARD_CARGOSPECS(cs) {
lst->push_back(new DropDownListStringItem(cs->name, cs->Index(), false));
*lst->Append() = new DropDownListStringItem(cs->name, cs->Index(), false);
}
if (lst->size() == 0) {
if (lst->Length() == 0) {
delete lst;
break;
}
@@ -2607,9 +2607,9 @@ struct IndustryCargoesWindow : public Window {
IndustryType ind = _sorted_industry_types[i];
const IndustrySpec *indsp = GetIndustrySpec(ind);
if (!indsp->enabled) continue;
lst->push_back(new DropDownListStringItem(indsp->name, ind, false));
*lst->Append() = new DropDownListStringItem(indsp->name, ind, false);
}
if (lst->size() == 0) {
if (lst->Length() == 0) {
delete lst;
break;
}