Skip to content

PHPC-1748 Fix wrong return value of Cursor::key when iterator is not valid #1192

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

Merged
merged 2 commits into from
Jan 25, 2021

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Jan 21, 2021

@alcaeus alcaeus requested a review from jmikola January 21, 2021 13:21
@alcaeus alcaeus self-assigned this Jan 21, 2021
ZVAL_NULL(key);
return;
}

Copy link
Member

Choose a reason for hiding this comment

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

Since you introduced the Iterator methods, it looks like php_phongo_cursor_get_current_key and php_phongo_cursor_get_current_data are only called from key() and current(), respectively. Can we just delete these two functions?

That would allow you to move this logic into key(), which would be consistent with what you did for current() in 70a097e.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I can refactor this 👍

@alcaeus alcaeus merged commit 24eb9bc into mongodb:v1.9 Jan 25, 2021
@alcaeus alcaeus deleted the phpc-1748 branch January 25, 2021 11:44
alcaeus added a commit that referenced this pull request Jan 26, 2021
* v1.9:
  Fix build failures with clang 12 (#1193)
  PHPC-1748 Fix wrong return value of Cursor::key when iterator is not valid (#1192)
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