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

Fixed segfault in Linkage::Criteria -- Patch for 5.0 #490

Merged
merged 2 commits into from
Aug 17, 2015

Conversation

mxgrey
Copy link
Member

@mxgrey mxgrey commented Aug 16, 2015

No description provided.

@@ -319,7 +319,7 @@ void Linkage::Criteria::expandToTarget(
}

// If we have successfully reached the target, expand from there
if(newBns.back() == _target.mNode.lock())
if(newBns.size() > 0 && newBns.back() == _target.mNode.lock())
Copy link
Member

Choose a reason for hiding this comment

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

As I known, !empty() is preferred over size() > 0 for emptiness check because, depending on the implementation, empty() has possibly less overhead and probably at worst it's the same.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good call, 👍

@jslee02
Copy link
Member

jslee02 commented Aug 17, 2015

Changed the emptiness check code using empty()

jslee02 added a commit that referenced this pull request Aug 17, 2015
Fixed segfault in Linkage::Criteria -- Patch for 5.0
@jslee02 jslee02 merged commit f4a8088 into release-5.0 Aug 17, 2015
@jslee02 jslee02 deleted the grey/fix_linkage_criteria branch January 31, 2016 02:52
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.

2 participants