Skip to content

Commit 1f8d78f

Browse files
committed
optimize
1 parent 1720a5d commit 1f8d78f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/Data/ProcessedBranchCoverageData.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ public function __construct(
5252
#[\NoDiscard]
5353
public function merge(self $data): self
5454
{
55+
if ($data->hit === []) {
56+
return $this;
57+
}
58+
5559
return new self(
5660
$this->op_start,
5761
$this->op_end,

src/Data/ProcessedPathCoverageData.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ public function __construct(
4242
#[\NoDiscard]
4343
public function merge(self $data): self
4444
{
45+
if ($data->hit === []) {
46+
return $this;
47+
}
48+
4549
return new self(
4650
$this->path,
4751
array_unique(array_merge($this->hit, $data->hit)),

0 commit comments

Comments
 (0)