Skip to content

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