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

buffer: use strict equality comparison #2641

Closed
wants to merge 1 commit into from
Closed

buffer: use strict equality comparison #2641

wants to merge 1 commit into from

Conversation

JungMinu
Copy link
Member

@JungMinu JungMinu commented Sep 2, 2015

There is no type-conversion to be done because both parameters are already the same type.
Therefore, the === operator should be used for better performance.

There is no type-conversion to be done because both parameters are already the same type. 
Therefore, the === operator should be used for better performance.
@targos
Copy link
Member

targos commented Sep 2, 2015

obj == null is equivalent to strictly comparing against null and undefined. The change you are proposing makes us lose the obj === undefined part. Therefore line 127 would throw if undefined is passed to the Buffer constructor.

@targos targos added the buffer Issues and PRs related to the buffer subsystem. label Sep 2, 2015
@targos
Copy link
Member

targos commented Sep 2, 2015

It should be caught by this test. Did you run make test ?

@JungMinu
Copy link
Member Author

JungMinu commented Sep 2, 2015

@targos Sorry, It was a mistake

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
buffer Issues and PRs related to the buffer subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants