1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-31 20:45:34 +00:00

Merge branch 'reserve' into 'master'

Use `reserve` on vectors for fixed loops

See merge request OpenMW/openmw!1182
This commit is contained in:
Evil Eye 2021-08-29 19:37:33 +00:00
commit 3149871b51
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);