Removes a useless nullification loop (#5561)

* Fixes #5606.
* The vector is a new instantiation so it will be free and clear from the start.
Thanks to @inhyositsu!
This commit is contained in:
Aleos 2020-12-09 14:13:14 -05:00 committed by GitHub
parent 41b5c78292
commit 844945d1cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10344,18 +10344,13 @@ static int pc_checkcombo(struct map_session_data *sd, item_data *data) {
struct s_itemchk {
int idx;
t_itemid nameid, card[MAX_SLOTS];
s_itemchk() : idx(0), nameid(0), card() {};
};
std::vector<s_itemchk> combo_idx;
std::vector<s_itemchk> combo_idx(nb_itemCombo);
size_t j;
unsigned int pos = 0;
combo_idx.reserve(nb_itemCombo);
// Zero out temporary combo array
for (auto &tmp_combo : combo_idx) {
tmp_combo = {};
}
for (j = 0; j < nb_itemCombo; j++) {
t_itemid id = item_combo->nameid[j];
bool found = false;