Skip to content

replace begin/end with front/back#531

Open
neheb wants to merge 1 commit intorakshasa:masterfrom
neheb:0z
Open

replace begin/end with front/back#531
neheb wants to merge 1 commit intorakshasa:masterfrom
neheb:0z

Conversation

@neheb
Copy link
Copy Markdown
Contributor

@neheb neheb commented Jul 5, 2025

A little cleaner.

throw internal_error("ChunkList::release(...) received an invalid handle.");

if (handle->object() < &*begin() || handle->object() >= &*end())
if (handle->object() < &front() || handle->object() >= &back())
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

End is off by one, should be >.

However I don't like this change as begin/end are more natural for iterators/position comparisons.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I assume you mean &front/back and not simple front/back.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

No, I mean it is more natural to use begin/end when dealing with comparison of position.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed.

A little cleaner.

Signed-off-by: Rosen Penev <[email protected]>
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