-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Fixes #10633 - multiple statements simplified by removing explicit comparison #10698
base: main
Are you sure you want to change the base?
Conversation
@dotnet-policy-bot agree |
@dotnet-policy-service agree |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - a few things to fix before we can merge.
@@ -76,7 +76,7 @@ int main(array<String^>^ args) | |||
String^ answer = Console::ReadLine(); | |||
// If the user canceled the send, and mail hasn't been | |||
// sent yet,then cancel the pending operation. | |||
if (answer->ToLower()->StartsWith("c") && mailSent == false) | |||
if (!answer->ToLower()->StartsWith("c") && mailSent) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!answer->ToLower()->StartsWith("c") && mailSent) | |
if (!(answer->ToLower()->StartsWith("c") && mailSent)) |
@@ -2269,7 +2269,7 @@ jQuery.event = { | |||
elem = window; | |||
} | |||
|
|||
if ( handler === false ) { | |||
if (! handler) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (! handler) { | |
if (!handler) { |
@@ -2416,7 +2416,7 @@ jQuery.event = { | |||
return; | |||
} | |||
|
|||
if ( handler === false ) { | |||
if (! handler) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (! handler) { | |
if (!handler) { |
@@ -2713,7 +2713,7 @@ jQuery.event = { | |||
|
|||
if ( ret !== undefined ) { | |||
event.result = ret; | |||
if ( ret === false ) { | |||
if (! ret) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (! ret) { | |
if (!ret) { |
maxLevel = match.level; | ||
|
||
if ( ret === false ) { | ||
if (! ret) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (! ret) { | |
if (!ret) { |
@@ -6714,7 +6714,7 @@ jQuery.extend({ | |||
} | |||
|
|||
// Set the correct header, if data is being sent | |||
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { | |||
if ( s.data && s.hasContent && !s.contentType || options.contentType ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if ( s.data && s.hasContent && !s.contentType || options.contentType ) { | |
if ( s.data && s.hasContent && s.contentType || options.contentType ) { |
@@ -7051,7 +7051,7 @@ jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { | |||
if ( s.dataTypes[ 0 ] === "jsonp" || | |||
originalSettings.jsonpCallback || | |||
originalSettings.jsonp != null || | |||
s.jsonp !== false && ( jsre.test( s.url ) || | |||
!s.jsonp && ( jsre.test( s.url ) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!s.jsonp && ( jsre.test( s.url ) || | |
s.jsonp && ( jsre.test( s.url ) || |
@@ -3459,7 +3459,7 @@ $.widget("ui.sortable", $.ui.mouse, { | |||
|
|||
} | |||
|
|||
if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) | |||
if(!scrolled && $.ui.ddmanager && !o.dropBehaviour) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(!scrolled && $.ui.ddmanager && !o.dropBehaviour) | |
if(scrolled && $.ui.ddmanager && !o.dropBehaviour) |
@@ -5168,7 +5168,7 @@ $.widget( "ui.autocomplete", { | |||
} | |||
|
|||
clearTimeout( this.closing ); | |||
if ( this._trigger( "search", event ) === false ) { | |||
if (! this._trigger( "search", event )) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (! this._trigger( "search", event )) { | |
if (!this._trigger( "search", event )) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also remove the other spaces like this in this file?
@@ -309,7 +309,7 @@ Sys.Mvc.MvcHelpers._onComplete = function Sys_Mvc_MvcHelpers$_onComplete(request | |||
/// <param name="ajaxContext" type="Sys.Mvc.AjaxContext"> | |||
/// </param> | |||
ajaxContext.set_response(request.get_executor()); | |||
if (ajaxOptions.onComplete && ajaxOptions.onComplete(ajaxContext) === false) { | |||
if (!ajaxOptions.onComplete && ajaxOptions.onComplete(ajaxContext)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!ajaxOptions.onComplete && ajaxOptions.onComplete(ajaxContext)) { | |
if (!(ajaxOptions.onComplete && ajaxOptions.onComplete(ajaxContext))) { |
Summary
Multiple if and while statements simplified by removing explicit comparison and replacing with logical NOT operator as required.
Fixes #10633