Skip to content

Commit

Permalink
Merge pull request #115 from joubertredrat/master
Browse files Browse the repository at this point in the history
small refactor on return in function
  • Loading branch information
darwinz authored Sep 13, 2023
2 parents 9f88138 + f0d85a7 commit e967070
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions Strings/CheckAnagram.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,5 @@ function isAnagram(string $originalString, string $testString, bool $caseInsensi

// count_chars(string, mode = 1) returns key-value pairs with character as key, frequency as value
// We can directly compare the arrays in this case
if (count_chars($originalString, 1) == count_chars($testString, 1))
{
return true;
}
else
{
return false;
}
return count_chars($originalString, 1) === count_chars($testString, 1);
}

0 comments on commit e967070

Please sign in to comment.