| 541 | } |
| 542 | |
| 543 | void ScriptList::AddList(ScriptList *list) |
| 544 | { |
| 545 | if (list == this) return; |
| 546 | |
| 547 | if (this->IsEmpty()) { |
| 548 | /* If this is empty, we can just take the items of the other list as is. */ |
| 549 | this->items = list->items; |
| 550 | this->values = list->values; |
| 551 | this->modifications++; |
| 552 | } else { |
| 553 | for (const auto &item : list->items) { |
| 554 | this->AddItem(item.first); |
| 555 | this->SetValue(item.first, item.second); |
| 556 | } |
| 557 | } |
| 558 | } |
| 559 | |
| 560 | void ScriptList::SwapList(ScriptList *list) |
| 561 | { |