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 Str::startsWith() end endsWith() with empty needles #2628

Merged
merged 3 commits into from
Nov 13, 2013
Merged

Fix Str::startsWith() end endsWith() with empty needles #2628

merged 3 commits into from
Nov 13, 2013

Conversation

vlakoff
Copy link
Contributor

@vlakoff vlakoff commented Nov 3, 2013

Follow-up to #2627.

Also includes a code optimization.

@taylorotwell
Copy link
Member

Why should "endsWIth" always return true if you pass an empty string?

@vlakoff
Copy link
Contributor Author

vlakoff commented Nov 3, 2013

What interests me the most is that these functions have the same (and determined) behaviour with this use case, whether it's returning true, false, producing a warning or throwing an invalidargumentexception.

@taylorotwell
Copy link
Member

They should return false IMO.


Sent from Mailbox for iPhone

On Sun, Nov 3, 2013 at 2:14 PM, vlakoff [email protected] wrote:

What interests me the most is that these functions have the same (and determined) behaviour with this use case, whether it's returning true, false, producing a warning or throwing an invalidargumentexception.

Reply to this email directly or view it on GitHub:
#2628 (comment)

@daylerees
Copy link
Contributor

My gut tells me that they should return false. (and that I'm hungry.)

@vlakoff
Copy link
Contributor Author

vlakoff commented Nov 7, 2013

PR updated. Return false, no warnings. As more, endsWith() optimization and docblock tidying :-)

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.

3 participants