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

Adds iterator and const_iterator for TileLayer #1640

Merged
merged 4 commits into from Jul 10, 2017

Conversation

@ketanhwr
Copy link
Contributor

@ketanhwr ketanhwr commented Jul 6, 2017

Follow up for #1635.

ketanhwr added 3 commits Jul 6, 2017
Copy link
Member

@bjorn bjorn left a comment

Looking nice overal! I left a few small comments, which apply to both iterators.

In general, I think it would be nice to take the definitions out of the declarations, like I've already done with some of the inline functions of TileLayer. This keeps the API more readable.

if (mChunkPointer != mChunkEndPointer)
mCellPointer = mChunkPointer.value().begin();
}
}

This comment has been minimized.

@bjorn

bjorn Jul 10, 2017
Member

This code is duplicated in the postfix version and I think would be good to separate out in a private advance function.


Cell &value() { return *mCellPointer; }

const QPoint key()

This comment has been minimized.

@bjorn

bjorn Jul 10, 2017
Member

The function itself should be const, not the return value.

return lhs.mCellPointer != rhs.mCellPointer;
}

Cell &value() { return *mCellPointer; }

This comment has been minimized.

@bjorn

bjorn Jul 10, 2017
Member

Since this operator doesn't change the iterator, it should still be marked const.


Cell &operator*() { return *mCellPointer; }

QVector<Cell>::iterator operator->() { return mCellPointer; }

This comment has been minimized.

@bjorn

bjorn Jul 10, 2017
Member

operator should be const since it doesn't modify the iterator.

@bjorn bjorn merged commit c5b1292 into mapeditor:master Jul 10, 2017
0 of 2 checks passed
0 of 2 checks passed
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
@bjorn
Copy link
Member

@bjorn bjorn commented Jul 10, 2017

Thanks!

@ketanhwr ketanhwr deleted the ketanhwr:infinite-maps branch Jul 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.