Skip to content

Commit

Permalink
Improved FixedArrayIntersection execution speed
Browse files Browse the repository at this point in the history
  • Loading branch information
k-samuel committed Aug 12, 2024
1 parent 163ed26 commit 444ff8a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Index/Intersection/FixedArrayIntersection.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ class FixedArrayIntersection implements IntersectionInterface
public function getIntersectMapCount($a, array $b): int
{
$intersectLen = 0;

foreach ($a as $key) {
if (isset($b[$key])) {
$count = count($a);
for ($i = 0; $i < $count; $i++) {
if (isset($b[$a[$i]])) {
$intersectLen++;
}
}
Expand Down

0 comments on commit 444ff8a

Please sign in to comment.