Skip to content

Commit 862ddbd

Browse files
committed
Fix: sonarqube smells
1 parent 61facd2 commit 862ddbd

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/System.Net.IPNetwork/IPNetwork2Contains.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public bool Contains(IPAddress contains)
7070

7171
BigInteger uintNetwork = this.InternalNetwork;
7272
BigInteger
73-
uintBroadcast = this.InternalBroadcast; // CreateBroadcast(ref uintNetwork, this._netmask, this._family);
73+
uintBroadcast = this.InternalBroadcast;
7474
var uintAddress = ToBigInteger(contains);
7575

7676
bool result = uintAddress >= uintNetwork
@@ -93,12 +93,12 @@ public bool Contains(IPNetwork2 contains)
9393

9494
BigInteger uintNetwork = this.InternalNetwork;
9595
BigInteger
96-
uintBroadcast = this.InternalBroadcast; // CreateBroadcast(ref uintNetwork, this._netmask, this._family);
96+
uintBroadcast = this.InternalBroadcast;
9797

9898
BigInteger uintFirst = contains.InternalNetwork;
9999
BigInteger
100100
uintLast = contains
101-
.InternalBroadcast; // CreateBroadcast(ref uintFirst, network2._netmask, network2._family);
101+
.InternalBroadcast;
102102

103103
bool result = uintFirst >= uintNetwork
104104
&& uintLast <= uintBroadcast;

src/TestProject/IPNetworkTest/IPNetworkParseTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,8 @@ public void TestParseIPAddressNoNetmask5()
581581
public void TestParseIPAddressNoNetmask127001()
582582
{
583583
string ipaddress = "127.0.0.1";
584-
IPNetwork2.TryParse(ipaddress, out IPNetwork2 result);
584+
bool parsed = IPNetwork2.TryParse(ipaddress, out IPNetwork2 result);
585+
Assert.IsTrue(parsed);
585586
Assert.AreEqual(8, result.Cidr);
586587
}
587588

0 commit comments

Comments
 (0)