Skip to content

Commit 025cba2

Browse files
authored
Improve readability as a follow up to e302692 (#7107)
* Improve readability as a follow up to e302692 * Addressed feedback
1 parent d8f2f09 commit 025cba2

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

src/NuGet.Core/NuGet.ProjectModel/LockFile/LockFileItem.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,14 @@ public bool Equals(LockFileItem other)
5858
bool thisEmpty = _properties == null || _properties.Count == 0;
5959
bool otherEmpty = other._properties == null || other._properties.Count == 0;
6060

61-
if (thisEmpty && otherEmpty)
61+
if (thisEmpty || otherEmpty)
6262
{
63-
return true;
63+
return thisEmpty && otherEmpty;
6464
}
65-
66-
if (thisEmpty || otherEmpty)
65+
else
6766
{
68-
return false;
67+
return _properties.OrderedEquals(other._properties, pair => pair.Key, StringComparer.Ordinal);
6968
}
70-
71-
return _properties.OrderedEquals(other._properties, pair => pair.Key, StringComparer.Ordinal);
7269
}
7370

7471
return false;

0 commit comments

Comments
 (0)