We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b43b25d commit b01ce4eCopy full SHA for b01ce4e
Algorithms/Strings/Permutations.cs
@@ -60,15 +60,9 @@ public static HashSet<string> Compute(string Source)
60
/// </summary>
61
public static bool IsAnargram(string Source, string Other)
62
{
63
- bool nullCheck = false;
64
int sourceCharSum = 0, otherCharSum = 0;
65
- bool isSourceNull = string.IsNullOrEmpty (Source);
66
- bool isOtherNull = string.IsNullOrEmpty (Other);
67
68
- // Null values check
69
- nullCheck |= (isSourceNull && isOtherNull) || (isSourceNull && !isOtherNull) || (!isSourceNull && isOtherNull);
70
-
71
- if (nullCheck == true)
+ if (string.IsNullOrEmpty (Source) || string.IsNullOrEmpty (Other))
72
return false;
73
else if (Source.Length != Other.Length)
74
0 commit comments