Skip to content

Commit e6d5a9e

Browse files
authored
Fixes dotnet#10633 - multiple statements simplified by removing explicit comparison (dotnet#10698)
1 parent 56b0607 commit e6d5a9e

File tree

372 files changed

+1159
-1189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

372 files changed

+1159
-1189
lines changed

snippets/common/VS_Snippets_WebNet/Classic RequiredFieldValidator Example/Common/source.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
void ValidateBtn_Click(Object sender, EventArgs e) {
88

9-
if (Page.IsValid == true) {
9+
if (Page.IsValid) {
1010
lblOutput.Text = "Required field is filled!";
1111
}
1212
else {

snippets/cpp/VS_Snippets_CLR/AsyncDelegateExamples/cpp/polling.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void main()
2121
threadId, nullptr, nullptr);
2222

2323
// Poll while simulating work.
24-
while(result->IsCompleted == false)
24+
while(!result->IsCompleted)
2525
{
2626
Thread::Sleep(250);
2727
Console::Write(".");

snippets/cpp/VS_Snippets_CLR/T.TryParse/CPP/tp.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static void Show( bool parseResult, String^ typeName, String^ parseValue )
1616
String^ msgFailure = L"** Parse for {0} failed. Invalid input.";
1717

1818
//
19-
if ( parseResult == true )
19+
if ( parseResult )
2020
Console::WriteLine( msgSuccess, typeName, parseValue );
2121
else
2222
Console::WriteLine( msgFailure, typeName );

snippets/cpp/VS_Snippets_CLR/console.beep/CPP/beep.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ int main()
88
int x = 0;
99

1010
//
11-
if ( (args->Length == 2) && (Int32::TryParse( args[ 1 ], x ) == true) && ((x >= 1) && (x <= 9)) )
11+
if ( (args->Length == 2) && (Int32::TryParse( args[ 1 ], x )) && ((x >= 1) && (x <= 9)) )
1212
{
1313
for ( int i = 1; i <= x; i++ )
1414
{

snippets/cpp/VS_Snippets_CLR/console.cursorvis/CPP/vis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ int main()
2121
{
2222
Console::WriteLine( m1, ((Console::CursorVisible == true) ? (String^)"VISIBLE" : "HIDDEN") );
2323
s = Console::ReadLine();
24-
if ( String::IsNullOrEmpty( s ) == false )
24+
if ( !String::IsNullOrEmpty( s ) )
2525
if ( s[ 0 ] == '+' )
2626
Console::CursorVisible = true;
2727
else

snippets/cpp/VS_Snippets_CLR/console.keyavailable/CPP/ka.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ int main()
1111

1212
// Your code could perform some useful task in the following loop. However,
1313
// for the sake of this example we'll merely pause for a quarter second.
14-
while ( Console::KeyAvailable == false )
14+
while ( !Console::KeyAvailable )
1515
Thread::Sleep( 250 );
1616
cki = Console::ReadKey( true );
1717
Console::WriteLine( "You pressed the '{0}' key.", cki.Key );

snippets/cpp/VS_Snippets_CLR/directoryinfocreatesub/CPP/directoryinfocreatesub.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ int main()
99
DirectoryInfo^ di = gcnew DirectoryInfo( "TempDir" );
1010

1111
// Create the directory only if it does not already exist.
12-
if ( di->Exists == false )
12+
if ( !di->Exists )
1313
di->Create();
1414

1515

snippets/cpp/VS_Snippets_CLR_System/system.GC.ReRegisterForFinalize Example/CPP/class1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ref class MyFinalizeObject
1717

1818
~MyFinalizeObject()
1919
{
20-
if ( hasFinalized == false )
20+
if ( !hasFinalized )
2121
{
2222
Console::WriteLine( "First finalization" );
2323

snippets/cpp/VS_Snippets_CLR_System/system.Random.Next/CPP/next3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ void main()
88
unsigned int numbers = 0;
99
Random^ rnd = gcnew Random();
1010

11-
if (! UInt32::TryParse(line, numbers))
11+
if (!UInt32::TryParse(line, numbers))
1212
numbers = 10;
1313

1414
for (unsigned int ctr = 1; ctr <= numbers; ctr++)

snippets/cpp/VS_Snippets_CLR_System/system.String.Format/cpp/formatexample2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ref class CustomerFormatter : IFormatProvider, ICustomFormatter
2121
Object^ arg,
2222
IFormatProvider^ formatProvider)
2323
{
24-
if (! this->Equals(formatProvider))
24+
if (!this->Equals(formatProvider))
2525
{
2626
return nullptr;
2727
}

snippets/cpp/VS_Snippets_CLR_System/system.runtime.compilerservices.internalsvisibletoattribute/cpp/friend1.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ref class FileUtilities
55
public:
66
static String^ AppendDirectorySeparator(String^ dir)
77
{
8-
if (! dir->Trim()->EndsWith(System::IO::Path::DirectorySeparatorChar.ToString()))
8+
if (!dir->Trim()->EndsWith(System::IO::Path::DirectorySeparatorChar.ToString()))
99
return dir->Trim() + System::IO::Path::DirectorySeparatorChar;
1010
else
1111
return dir;

snippets/cpp/VS_Snippets_Remoting/ClassicTcpClient.PublicMethodsAndPropertiesExample/CPP/source.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public ref class MyTcpClientExample
166166
tcpClient->NoDelay = true;
167167

168168
// Determines if the delay is enabled by using the NoDelay property.
169-
if ( tcpClient->NoDelay == true )
169+
if ( tcpClient->NoDelay)
170170
Console::WriteLine( "The delay was set successfully to {0}", tcpClient->NoDelay );
171171

172172

snippets/cpp/VS_Snippets_Remoting/DiscoveryDocument_DiscoveryDocument/CPP/discoverydocument_discoverydocument.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ int main()
4141
// <Snippet3>
4242
// <Snippet4>
4343
// Check whether the given XmlTextReader is readable.
44-
if ( DiscoveryDocument::CanRead( myXmlTextReader ) == true )
44+
if ( DiscoveryDocument::CanRead( myXmlTextReader ) )
4545

4646
// Read the given XmlTextReader.
4747
myDiscoveryDocument = DiscoveryDocument::Read( myXmlTextReader );

snippets/cpp/VS_Snippets_Remoting/DiscoveryExceptionDictionary_Property_Method/CPP/discoveryexceptiondictionary_property_method.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ int main()
4848

4949
// <Snippet2>
5050
DiscoveryExceptionDictionary^ myExceptionDictionary = myDiscoveryClientProtocol2->Errors;
51-
if ( myExceptionDictionary->Contains( myUrlKey ) == true )
51+
if ( myExceptionDictionary->Contains( myUrlKey ))
5252
{
5353
Console::WriteLine( "'myExceptionDictionary' contains a discovery exception for the key '{0}'", myUrlKey );
5454
}
@@ -57,7 +57,7 @@ int main()
5757
Console::WriteLine( "'myExceptionDictionary' does not contain a discovery exception for the key '{0}'", myUrlKey );
5858
}
5959
// </Snippet2>
60-
if ( myExceptionDictionary->Contains( myUrlKey ) == true )
60+
if ( myExceptionDictionary->Contains( myUrlKey ) )
6161
{
6262
Console::WriteLine( "System generated exceptions." );
6363

snippets/cpp/VS_Snippets_Remoting/DiscoveryReferenceCollection/CPP/discoveryreferencecollection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ int main()
3838
Console::WriteLine( "The number of elements in the collection after adding two elements to the collection: {0}", myDiscoveryReferenceCollection->Count );
3939

4040
// Call the Contains method.
41-
if ( myDiscoveryReferenceCollection->Contains( myDiscoveryDocReference1 ) != true )
41+
if ( !myDiscoveryReferenceCollection->Contains( myDiscoveryDocReference1 ) )
4242
{
4343
throw gcnew Exception( "Element not found in collection." );
4444
}

snippets/cpp/VS_Snippets_Remoting/IChannelReceiver_StartListening_ChannelData/CPP/ichannelreceiver_channeldata_server.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ ref class MyCustomChannel: public IChannelReceiver
115115
// Start listening to the port.
116116
virtual void StartListening( Object^ data )
117117
{
118-
if ( myListening == false )
118+
if ( !myListening )
119119
{
120120
myTcpListener->Start();
121121
myListening = true;
@@ -128,7 +128,7 @@ ref class MyCustomChannel: public IChannelReceiver
128128
// Stop listening to the port.
129129
virtual void StopListening( Object^ data )
130130
{
131-
if ( myListening == true )
131+
if ( myListening )
132132
{
133133
myTcpListener->Stop();
134134
myListening = false;

snippets/cpp/VS_Snippets_Remoting/Message.Acknowledgment/CPP/message_acknowledgment.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ ref class MyNewQueue
107107
// This exception would be thrown if there is no (further) acknowledgment message
108108
// with the specified correlation Id. Only output a message if there are no messages;
109109
// not if the loop has found at least one.
110-
if ( found == false )
110+
if ( !found )
111111
{
112112
Console::WriteLine( e->Message );
113113
}

snippets/cpp/VS_Snippets_Remoting/MessageQueue.Receive_TimeoutTransaction/CPP/mqreceive_timeouttransaction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ref class MyNewQueue
2323
MessageQueue^ myQueue = gcnew MessageQueue( ".\\myTransactionalQueue" );
2424

2525
// Send a message to the queue.
26-
if ( myQueue->Transactional == true )
26+
if ( myQueue->Transactional)
2727
{
2828
// Create a transaction.
2929
MessageQueueTransaction^ myTransaction = gcnew MessageQueueTransaction;

snippets/cpp/VS_Snippets_Remoting/MessageQueue.Receive_transaction/CPP/mqreceive_transaction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ref class MyNewQueue
2323
MessageQueue^ myQueue = gcnew MessageQueue( ".\\myTransactionalQueue" );
2424

2525
// Send a message to the queue.
26-
if ( myQueue->Transactional == true )
26+
if ( myQueue->Transactional )
2727
{
2828
// Create a transaction.
2929
MessageQueueTransaction^ myTransaction = gcnew MessageQueueTransaction;

snippets/cpp/VS_Snippets_Remoting/MessageQueue.Send_ObjectTransaction/CPP/mqsend_objtransaction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ref class MyNewQueue
2323
MessageQueue^ myQueue = gcnew MessageQueue( ".\\myTransactionalQueue" );
2424

2525
// Send a message to the queue.
26-
if ( myQueue->Transactional == true )
26+
if ( myQueue->Transactional )
2727
{
2828
// Create a transaction.
2929
MessageQueueTransaction^ myTransaction = gcnew MessageQueueTransaction;

snippets/cpp/VS_Snippets_Remoting/MessageQueue.Send_obj/CPP/mqsend_generic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ref class MyNewQueue
1616
MessageQueue^ myQueue = gcnew MessageQueue( ".\\myQueue" );
1717

1818
// Send a message to the queue.
19-
if ( myQueue->Transactional == true )
19+
if ( myQueue->Transactional )
2020
{
2121

2222
// Create a transaction.

snippets/cpp/VS_Snippets_Remoting/NCLCredPolicy/CPP/NCLCredPolicy.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public ref class SelectedHostsCredentialPolicy: public ICredentialPolicy
2020
virtual bool ShouldSendCredential( Uri^ challengeUri, WebRequest^ request, NetworkCredential^ /*credential*/, IAuthenticationModule^ /*authModule*/ )
2121
{
2222
Console::WriteLine( L"Checking custom credential policy." );
23-
if ( request->RequestUri->Host->Equals( L"www.contoso.com" ) || challengeUri->IsLoopback == true )
23+
if ( request->RequestUri->Host->Equals( L"www.contoso.com" ) || challengeUri->IsLoopback )
2424
return true;
2525

2626
return false;
@@ -41,7 +41,7 @@ public ref class HttpsBasicCredentialPolicy: public IntranetZoneCredentialPolicy
4141
{
4242
Console::WriteLine( L"Checking custom credential policy for HTTPS and basic." );
4343
bool answer = IntranetZoneCredentialPolicy::ShouldSendCredential( challengeUri, request, credential, authModule );
44-
if ( answer == true )
44+
if ( answer )
4545
{
4646
Console::WriteLine( L"Sending credential for intranet resource." );
4747
return answer;

snippets/cpp/VS_Snippets_Remoting/NCLFtpClient/CPP/ftptests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ public ref class FtpRequestTest
458458
// Example: ftp://contoso.com/someFile.txt.
459459
//
460460
// The command parameter identifies the command to send to the server.
461-
if ( serverUri->ToLower()->StartsWith( Uri::UriSchemeFtp ) == false )
461+
if ( !serverUri->ToLower()->StartsWith( Uri::UriSchemeFtp ) )
462462
{
463463
return false;
464464
}

snippets/cpp/VS_Snippets_Remoting/NCLNetInfo2/CPP/networkexamples.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ void DisplayIPv4NetworkInterfaces()
823823
NetworkInterface ^ adapter = safe_cast<NetworkInterface ^>(myEnum23->Current);
824824

825825
// Only display informatin for interfaces that support IPv4.
826-
if ( adapter->Supports( NetworkInterfaceComponent::IPv4 ) == false )
826+
if ( !adapter->Supports( NetworkInterfaceComponent::IPv4 ) )
827827
{
828828
continue;
829829
}
@@ -875,7 +875,7 @@ void DisplayIPv6NetworkInterfaces()
875875
NetworkInterface ^ adapter = safe_cast<NetworkInterface ^>(myEnum24->Current);
876876

877877
// Only display informatin for interfaces that support IPv6.
878-
if ( adapter->Supports( NetworkInterfaceComponent::IPv6 ) == false )
878+
if ( !adapter->Supports( NetworkInterfaceComponent::IPv6 ) )
879879
{
880880
continue;
881881
}

snippets/cpp/VS_Snippets_Remoting/NCLUriEnhancements/CPP/nclurienhancements.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void SampleTryCreate()
1616

1717
// Parse the string and create a new Uri instance, if possible.
1818
Uri^ result;
19-
if ( Uri::TryCreate( addressString, UriKind::RelativeOrAbsolute, result ) == true )
19+
if ( Uri::TryCreate( addressString, UriKind::RelativeOrAbsolute, result ) )
2020
{
2121
// The call was successful. Write the URI address to the console.
2222
Console::Write( result );

snippets/cpp/VS_Snippets_Remoting/NCLUriExamples/CPP/uriexamples.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ namespace Example
112112

113113
//<snippet1>
114114
char testChar = 'e';
115-
if ( Uri::IsHexDigit( testChar ) == true )
115+
if ( Uri::IsHexDigit( testChar ) )
116116
{
117117
Console::WriteLine( "'{0}' is the hexadecimal representation of {1}",
118118
testChar, Uri::FromHex( testChar ) );
@@ -236,7 +236,7 @@ namespace Example
236236

237237
#if OLDMETHOD
238238
Uri^ result;
239-
if ( Uri::TryParse( uriString, false, false, result ) == true )
239+
if ( Uri::TryParse( uriString, false, false, result ) )
240240
{
241241
Console::WriteLine( "{0} is a valid Uri", result );
242242
}

snippets/cpp/VS_Snippets_Remoting/NclMailASync/cpp/mailasync.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int main(array<String^>^ args)
7676
String^ answer = Console::ReadLine();
7777
// If the user canceled the send, and mail hasn't been
7878
// sent yet,then cancel the pending operation.
79-
if (answer->ToLower()->StartsWith("c") && mailSent == false)
79+
if (answer->ToLower()->StartsWith("c") && !mailSent)
8080
{
8181
client->SendAsyncCancel();
8282
}

snippets/cpp/VS_Snippets_Remoting/NclSslClientAsync/CPP/NclSslClientAsync.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ public ref class SslTcpClient
302302
// while waiting for the asynchronous calls to complete.
303303
System::Threading::Thread::Sleep( 100 );
304304
}
305-
while ( complete != true && Console::KeyAvailable == false );
305+
while ( !complete && !Console::KeyAvailable );
306306

307307
if ( Console::KeyAvailable )
308308
{

snippets/cpp/VS_Snippets_Remoting/OperationCollection_Methods/CPP/operationcollection_methods.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ int main()
5151

5252
// <Snippet3>
5353
// <Snippet4>
54-
if ( myOperationCollection->Contains( myOperation ) == true )
54+
if ( myOperationCollection->Contains( myOperation ))
5555
{
5656
Console::WriteLine( "The index of the added 'myOperation' operation is : {0}", myOperationCollection->IndexOf( myOperation ) );
5757
}

snippets/cpp/VS_Snippets_Remoting/OperationMessageCollection_Sample/CPP/operationmessagecollection_sample.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ int main()
9393

9494
// <Snippet5>
9595
// <Snippet6>
96-
if ( myOperationMessageCollection->Contains( myOperationMessage ) == true )
96+
if ( myOperationMessageCollection->Contains( myOperationMessage ))
9797
{
9898
int myIndex = myOperationMessageCollection->IndexOf( myOperationMessage );
9999
Console::WriteLine( " The index of the Add operation message in the collection is : {0}", myIndex );

snippets/cpp/VS_Snippets_Remoting/Socket_Sync_Send_Receive/CPP/source.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ void RunUdpTests()
345345
Thread^ myThread1 = gcnew Thread( myThreadDelegate );
346346
myThread1->Start();
347347

348-
while ( myThread1->IsAlive == true )
348+
while ( myThread1->IsAlive )
349349
{
350350
NeedForDelegates::SendTo1();
351351
}
@@ -354,7 +354,7 @@ void RunUdpTests()
354354
Console::WriteLine( "UDP test2" );
355355
Thread^ myThread2 = gcnew Thread( gcnew ThreadStart( &NeedForDelegates::ReceiveFrom2 ) );
356356
myThread2->Start();
357-
while ( myThread2->IsAlive == true )
357+
while ( myThread2->IsAlive )
358358
{
359359
NeedForDelegates::SendTo2();
360360
}
@@ -363,7 +363,7 @@ void RunUdpTests()
363363
Console::WriteLine( "UDP test3" );
364364
Thread^ myThread3 = gcnew Thread( gcnew ThreadStart( &NeedForDelegates::ReceiveFrom3 ) );
365365
myThread3->Start();
366-
while ( myThread3->IsAlive == true )
366+
while ( myThread3->IsAlive )
367367
{
368368
NeedForDelegates::SendTo3();
369369
}
@@ -372,7 +372,7 @@ void RunUdpTests()
372372
Console::WriteLine( "UDP test4" );
373373
Thread^ myThread4 = gcnew Thread( gcnew ThreadStart( &NeedForDelegates::ReceiveFrom4 ) );
374374
myThread4->Start();
375-
while ( myThread4->IsAlive == true )
375+
while ( myThread4->IsAlive )
376376
{
377377
NeedForDelegates::SendTo4();
378378
}

snippets/cpp/VS_Snippets_Remoting/System.Net.ServicePoint/CPP/servicepoint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ int main()
143143
}
144144

145145
String^ proxy = args[ 1 ];
146-
if ( (rex->Match(proxy))->Success != true )
146+
if ( (!rex->Match(proxy))->Success)
147147
{
148148
Console::WriteLine( "Input string format not allowed." );
149149
return -1;

snippets/cpp/VS_Snippets_Remoting/System.Net.ServicePointWhidbey/cpp/servicepoint.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ int main(array<String^>^ args)
181181
}
182182
String^ proxy = args[1];
183183

184-
if ((expression->Match(proxy))->Success != true)
184+
if (!(expression->Match(proxy))->Success)
185185
{
186186
Console::WriteLine("Input string format not allowed.");
187187
return 0;

snippets/cpp/VS_Snippets_Winforms/Classic AttributeCollection.GetEnumerator Example/CPP/Source.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public ref class Form1: public Form
2626
// Prints the type of each attribute in the collection.
2727
Object^ myAttribute;
2828
System::Text::StringBuilder^ text = gcnew System::Text::StringBuilder;
29-
while ( ie->MoveNext() == true )
29+
while ( ie->MoveNext() )
3030
{
3131
myAttribute = ie->Current;
3232
text->Append( myAttribute );

snippets/cpp/VS_Snippets_Winforms/Classic CheckedListBox Example/CPP/source.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public ref class Form1: public System::Windows::Forms::Form
9797
{
9898
if ( !textBox1->Text->Equals( "" ) )
9999
{
100-
if ( checkedListBox1->CheckedItems->Contains( textBox1->Text ) == false )
100+
if ( !checkedListBox1->CheckedItems->Contains( textBox1->Text ) )
101101
checkedListBox1->Items->Add( textBox1->Text, CheckState::Checked );
102102
textBox1->Text = "";
103103
}
@@ -154,7 +154,7 @@ public ref class Form1: public System::Windows::Forms::Form
154154
IEnumerator^ myEnumerator;
155155
myEnumerator = checkedListBox1->CheckedIndices->GetEnumerator();
156156
int y;
157-
while ( myEnumerator->MoveNext() != false )
157+
while ( myEnumerator->MoveNext() )
158158
{
159159
y = safe_cast<Int32>(myEnumerator->Current);
160160
checkedListBox1->SetItemChecked( y, false );

0 commit comments

Comments
 (0)