Skip to content

Commit

Permalink
Avoid unnecessary import() calls
Browse files Browse the repository at this point in the history
  • Loading branch information
colinodell committed Feb 25, 2023
1 parent 11f0166 commit 3f93338
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/Extension/Footnote/Node/FootnoteRef.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public function __construct(ReferenceInterface $reference, ?string $content = nu
$this->reference = $reference;
$this->content = $content;

$this->data->import($data);
if (\count($data) > 0) {
$this->data->import($data);
}
}

public function getReference(): ReferenceInterface
Expand Down
4 changes: 3 additions & 1 deletion src/Node/Inline/AbstractStringContainer.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public function __construct(string $contents = '', array $data = [])
parent::__construct();

$this->literal = $contents;
$this->data->import($data);
if (\count($data) > 0) {
$this->data->import($data);
}
}

public function getLiteral(): string
Expand Down

0 comments on commit 3f93338

Please sign in to comment.