Skip to content

Effect: Fix a unnecessary conditional statement in .stop() #4375

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 1 commit into from
May 1, 2019
Merged

Effect: Fix a unnecessary conditional statement in .stop() #4375

merged 1 commit into from
May 1, 2019

Conversation

wonseop
Copy link
Contributor

@wonseop wonseop commented Apr 29, 2019

Summary

Because of the above conditional, the 'type' variable has a value of type 'string' or undefined.
Therefore, boolean comparisons for 'type' variable is always unnecessary because it return true.
The patch removed the unnecessary conditional statement.

Fix #4374

Checklist

Sorry, something went wrong.

Because of the above conditional, the 'type' variable has a value of type 'string' or undefined.
Therefore, boolean comparisons for 'type' variable is always unnecessary because it return true.
The patch removed the unnecessary conditional statement.
Copy link
Member

@gibson042 gibson042 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mgol
Copy link
Member

mgol commented Apr 30, 2019

Nice catch! For reference, the commit making this comparison redundant is 6c4ca13, landed more than 7 years ago!

@mgol mgol added the Effects label May 1, 2019
@mgol mgol added this to the 4.0.0 milestone May 1, 2019
@mgol mgol merged commit 110802c into jquery:master May 1, 2019
@mgol mgol modified the milestones: 4.0.0, 3.5.0 Sep 25, 2019
mgol pushed a commit that referenced this pull request Sep 25, 2019
Because of the above conditional, the 'type' variable has a value of type
'string' or undefined. Therefore, boolean comparisons for 'type' variable
is always unnecessary because it return true. The patch removed the
unnecessary conditional statement.

Fixes gh-4374
Closes gh-4375

(cherry picked from commit 110802c)
@mgol
Copy link
Member

mgol commented Sep 25, 2019

Cherry-picked to 3.x-stable in 30f5c6c.

@lock lock bot locked as resolved and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

jQuery.stop: Unnecessary conditional statement
3 participants