Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use std::make_shared #2242

Merged
merged 1 commit into from
Mar 11, 2019
Merged

Use std::make_shared #2242

merged 1 commit into from
Mar 11, 2019

Conversation

elsid
Copy link
Collaborator

@elsid elsid commented Mar 10, 2019

To prevent additional allocation for counter.

mKeyList->read(nif);
}

void NiUVData::read(NIFStream *nif)
{
for(int i = 0;i < 4;i++)
{
mKeyList[i].reset(new FloatKeyMap);
mKeyList[i] = std::make_shared<FloatKeyMap>();;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A redundant trailing semicolon.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

mKeyList[i]->read(nif);
}
}

void NiFloatData::read(NIFStream *nif)
{
mKeyList.reset(new FloatKeyMap);
mKeyList = std::make_shared<FloatKeyMap>();;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too.

@psi29a psi29a merged commit 7efdddd into OpenMW:master Mar 11, 2019
@elsid elsid deleted the make_shared branch March 17, 2019 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants