Skip to content

Don't spam vessel creations and deletions #1279

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

Merged
merged 10 commits into from
Mar 22, 2017

Conversation

eggrobin
Copy link
Member

Most of the commits here are traces to investigate the (unrelated) docking bug, which I think I understand now.

not_null<Vessel*> const vessel = it->second.get();
}
}
not_null<Vessel*> const vessel = FindOrDie(vessels_, vessel_guid).get();
Copy link
Member

Choose a reason for hiding this comment

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

Isn't it a bit ugly that we are doing a lookup here when we just did a lookup or an insert. I'd use vanilla STL:

auto it = vessels_.find(...);
if (it == vessels_.end()) {
   std::tie(...) = vessels_.emplace(...);
}
vessel = it->second;

@pleroy pleroy added the LGTM label Mar 22, 2017
@eggrobin eggrobin merged commit 0bc3557 into mockingbirdnest:master Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants