1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-25 16:43:33 +00:00

Use reserve on vectors for fixed loops

This is a bit useless, but has the merit of appeasing clang-tiday
This commit is contained in:
jvoisin 2021-08-29 19:20:49 +02:00
parent 4f99c060c3
commit a15cca5763
2 changed files with 3 additions and 0 deletions

View File

@ -517,6 +517,7 @@ namespace MWGui
std::vector<ESM::Skill::SkillEnum> CreateClassDialog::getMajorSkills() const
{
std::vector<ESM::Skill::SkillEnum> v;
v.reserve(5);
for(int i = 0; i < 5; i++)
{
v.push_back(mMajorSkill[i]->getSkillId());
@ -527,6 +528,7 @@ namespace MWGui
std::vector<ESM::Skill::SkillEnum> CreateClassDialog::getMinorSkills() const
{
std::vector<ESM::Skill::SkillEnum> v;
v.reserve(5);
for(int i=0; i < 5; i++)
{
v.push_back(mMinorSkill[i]->getSkillId());

View File

@ -191,6 +191,7 @@ namespace MWRender
screenshotH = screenshotW; // use square resolution for planet mapping
std::vector<osg::ref_ptr<osg::Image>> images;
images.reserve(6);
for (int i = 0; i < 6; ++i)
images.push_back(new osg::Image);