Browse Source

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!
Aleos 4 years ago
parent
commit
844945d1cf
1 changed files with 3 additions and 8 deletions
  1. 3 8
      src/map/pc.cpp

+ 3 - 8
src/map/pc.cpp

@@ -10344,18 +10344,13 @@ static int pc_checkcombo(struct map_session_data *sd, item_data *data) {
 		struct s_itemchk {
 		struct s_itemchk {
 			int idx;
 			int idx;
 			t_itemid nameid, card[MAX_SLOTS];
 			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;
 		size_t j;
 		unsigned int pos = 0;
 		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++) {
 		for (j = 0; j < nb_itemCombo; j++) {
 			t_itemid id = item_combo->nameid[j];
 			t_itemid id = item_combo->nameid[j];
 			bool found = false;
 			bool found = false;