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

Simplified and intuitive data check for Cursor. #42

Open
wants to merge 1 commit into
base: student
Choose a base branch
from

Conversation

rsd-raul
Copy link

@rsd-raul rsd-raul commented Mar 2, 2017

Rather than moving to the first element and checking if that was successful to set a flag and return if it failed, it's easier and more intuitive to ask if the cursor is null or empty, and finally, in case it contains information point the cursor to it.

PS: As doing the moveToFirst is mandatory, I think it's not a bad idea to isolate the call so people know straight away that is not a simple check.

Rather than moving to the first element and checking if that was successful to set a flag and return if it failed, it's easier and more intuitive to ask if the cursor is null or empty, and finally, in case it contains information point the cursor to it.

PS: As doing the `moveToFirst` is mandatory, I think it's not a bad idea to isolate the call so people know straight away that is not a simple check.
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.

1 participant