Skip to content

Be even more explicit about the semantics of _.isEmpty #2840

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 4 commits into from
Apr 14, 2020

Conversation

jgonggrijp
Copy link
Collaborator

This is meant to address #2804.

@mcurrao Please let me know whether this sufficiently addresses the problem for you.

@jashkenas jashkenas marked this pull request as ready for review April 10, 2020 18:27
@jashkenas jashkenas marked this pull request as draft April 10, 2020 18:27
@jgonggrijp
Copy link
Collaborator Author

jgonggrijp commented Apr 10, 2020

Thanks @jashkenas. As I understand it, you are fine with the current change (given that I have removed the counter-example that you rightly pointed out). So if @mcurrao requests no further changes, I'll not request another review from you before merging this.

@jgonggrijp jgonggrijp marked this pull request as ready for review April 10, 2020 21:39
@mcurrao
Copy link

mcurrao commented Apr 10, 2020

@jgonggrijp LGTM. Only missing elements would be functions, but as they can be considered non-enumerable objects, I guess there is no need to include them. Thanks!

@jgonggrijp jgonggrijp requested a review from jashkenas April 10, 2020 22:33
@jgonggrijp
Copy link
Collaborator Author

Sorry, requesting another review anyway because I just noticed a tautology in the code and removed it.

This reverts commit 0252976 and
addresses the review comment below:
jashkenas#2840 (comment)
@jgonggrijp jgonggrijp merged commit 4cf715f into jashkenas:master Apr 14, 2020
@jgonggrijp jgonggrijp deleted the empty-validation-warning branch April 14, 2020 22:11
jgonggrijp added a commit to jgonggrijp/underscore that referenced this pull request Aug 1, 2020
jgonggrijp added a commit to jgonggrijp/underscore that referenced this pull request Oct 24, 2020
After optimizing the internal tagTester function, I decided to re-
evaluate the optimization and benchmark discussed from

jashkenas#2840 (comment)

onwards. Now that tagTester is faster, the tradeoff posed by this
optimization had become less obviously in favor. Especially evaluating
the length of strings appeared to be relatively costly. I realized
this was happening twice, so I removed the redundant evaluation. This
could be done at a net zero weight change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants