Skip to content

Commit e967070

Browse files
authored
Merge pull request #115 from joubertredrat/master
small refactor on return in function
2 parents 9f88138 + f0d85a7 commit e967070

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

Strings/CheckAnagram.php

+1-8
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,5 @@ function isAnagram(string $originalString, string $testString, bool $caseInsensi
1818

1919
// count_chars(string, mode = 1) returns key-value pairs with character as key, frequency as value
2020
// We can directly compare the arrays in this case
21-
if (count_chars($originalString, 1) == count_chars($testString, 1))
22-
{
23-
return true;
24-
}
25-
else
26-
{
27-
return false;
28-
}
21+
return count_chars($originalString, 1) === count_chars($testString, 1);
2922
}

0 commit comments

Comments
 (0)