Skip to content

Commit

Permalink
Remove Message:exists (#39)
Browse files Browse the repository at this point in the history
Expensive resulting in many queries

ERM34902

Co-authored-by: hslater <[email protected]>
  • Loading branch information
HamishSlater and hslater authored Jan 15, 2024
1 parent 3aef413 commit 6566f3a
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
8 changes: 0 additions & 8 deletions src/Component/SimpleTreeLinkNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,13 @@ public function getSubComponents(): array {
* @return Message
*/
public function getText(): Message {
$msg = Message::newFromKey( $this->options['text'] );
if ( $msg->exists() ) {
return $msg;
}
return new RawMessage( $this->options['text'] );
}

/**
* @return Message
*/
public function getTitle(): Message {
$msg = Message::newFromKey( $this->options['title'] );
if ( $msg->exists() ) {
return $msg;
}
return new RawMessage( $this->options['title'] );
}

Expand Down
4 changes: 0 additions & 4 deletions src/Component/SimpleTreeTextNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ public function getSubComponents(): array {
* @return Message
*/
public function getText(): Message {
$msg = Message::newFromKey( $this->options['text'] );
if ( $msg->exists() ) {
return $msg;
}
return new RawMessage( $this->options['text'] );
}
}

0 comments on commit 6566f3a

Please sign in to comment.