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 bugs found while writing tests for DiscreteTrajectory2 #3153

Merged
merged 5 commits into from
Oct 16, 2021

Conversation

pleroy
Copy link
Member

@pleroy pleroy commented Oct 16, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
if (point == --segment_->timeline_end()) {
++segment_;
if (segment_ == segment_.end()) {
if (segment_ == segment_.end() || segment_->timeline_empty()) {
Copy link
Member

@eggrobin eggrobin Oct 16, 2021

Choose a reason for hiding this comment

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

let’s have an .is_end rather than a .end, this looks too much like segment_->end().

point_is_at_end ? std::nullopt : std::make_optional(point->first);
do {
if (point == segment_->timeline_begin()) {
CHECK(segment_ != segment_.begin());
Copy link
Member

Choose a reason for hiding this comment

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

.is_begin

if (is_at_end(point_)) {
bool const point_is_at_end = is_at_end(point_);
if (point_is_at_end) {
// Move the iterator to the end of the last segment.
segment_ = --segment_.end();
Copy link
Member

Choose a reason for hiding this comment

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

segment_.segments().end()?

@eggrobin eggrobin added the LGTM label Oct 16, 2021
@pleroy pleroy merged commit e0f13df into mockingbirdnest:Ondelette Oct 16, 2021
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