mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-31 17:45:35 +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:
commit
3149871b51
2 changed files with 3 additions and 0 deletions
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue