refactor(Core/Misc): Use emplace_back instead of push_back to avoid extra copy/m… (#20114)
refactor: Use emplace_back instead of push_back to avoid extra copy/move operations
This commit is contained in:
parent
cfb3229bf1
commit
9487b30ad7
10 changed files with 32 additions and 35 deletions
|
|
@ -362,7 +362,7 @@ public:
|
|||
continue;
|
||||
}
|
||||
|
||||
questItems.push_back(std::pair(id, count));
|
||||
questItems.emplace_back(id, count);
|
||||
}
|
||||
|
||||
if (!questItems.empty())
|
||||
|
|
@ -585,7 +585,7 @@ public:
|
|||
for (uint32 const& itemId : quest->RewardChoiceItemId)
|
||||
{
|
||||
uint8 index = 0;
|
||||
questRewardItems.push_back(std::pair(itemId, quest->RewardChoiceItemCount[index++]));
|
||||
questRewardItems.emplace_back(itemId, quest->RewardChoiceItemCount[index++]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -594,7 +594,7 @@ public:
|
|||
for (uint32 const& itemId : quest->RewardItemId)
|
||||
{
|
||||
uint8 index = 0;
|
||||
questRewardItems.push_back(std::pair(itemId, quest->RewardItemIdCount[index++]));
|
||||
questRewardItems.emplace_back(itemId, quest->RewardItemIdCount[index++]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue