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

Optimizations #41

Merged
merged 2 commits into from
Feb 18, 2019
Merged

Optimizations #41

merged 2 commits into from
Feb 18, 2019

Conversation

streamich
Copy link
Contributor

Removes two unnecessary expressions:

  • b instanceof Element is not needed because if a is instanceof Elemement and tripple equals is used a === b, then b must be instance of Element, too.
  • a === b is not needed, as the very first line of this function already checks for that: if (a === b) return true;.

On the next line tripple equals === should ensure b is instance of
Element.
The very first line of the function already checks `if (a === b) return
true;`, so at this point we know for sure that a !== b
@chrisbolin
Copy link
Contributor

super smart! thank you @streamich

@chrisbolin chrisbolin merged commit 294d6e0 into FormidableLabs:master Feb 18, 2019
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.

2 participants