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

Fix for the ASSERTION bug that Niklas discovered. #208

Merged
merged 3 commits into from Mar 18, 2019

Conversation

joka921
Copy link
Member

@joka921 joka921 commented Mar 15, 2019

It should be commented, check out if this fixes your issue.

Copy link
Member

@niklas88 niklas88 left a comment

Choose a reason for hiding this comment

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

Nice find and a quick one too. I've a tiny nitpick and would like to test this still but other than that, great work!

// will have an empty result since the first
// entry is already too big. In this case our result will
// be empty and we can perform a short cut.
if (it != _blocks.begin()) {
Copy link
Member

Choose a reason for hiding this comment

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

I think the comments are great but we can still make the code a bit more understandable by turning this into a positive condition:

if (it == _blocks.begin()) {
   // always empty result…
   return {it->_startOffset, 0};
}
it--;

also we could use the {} syntax for the other return as well

@niklas88
Copy link
Member

The else is now redundant because of the return which I think makes it more readable too

@niklas88 niklas88 merged commit 9b1871e into ad-freiburg:master Mar 18, 2019
@joka921 joka921 deleted the f.fixBlockAssert branch August 24, 2022 09:12
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.

None yet

2 participants