From 614f30f53dabd096d2a6b8c8ca7d5ef2b09aea66 Mon Sep 17 00:00:00 2001 From: Sasha Ivanenko <46720998+girafffee@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:53:06 +0200 Subject: [PATCH] Minor perfomance improvement --- includes/form-messages/manager.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/includes/form-messages/manager.php b/includes/form-messages/manager.php index 65f4cae84..0baabdb7a 100644 --- a/includes/form-messages/manager.php +++ b/includes/form-messages/manager.php @@ -43,13 +43,14 @@ public function get_form_types_messages() { public function get_action_types_messages() { $messages = array(); + $actions = array(); /** @var Base $action */ foreach ( jet_form_builder()->msg_router->get_actions() as $action ) { - $messages = array_merge( $messages, Action_Messages_Manager::instance()->get_messages_values( $action ) ); + $actions[] = Action_Messages_Manager::instance()->get_messages_values( $action ); } - return $messages; + return array_merge( $messages, ...$actions ); } public function isset_message_type( $type ) { @@ -108,19 +109,19 @@ public static function parse_message( $status ) { } /** - * @since 3.1.0 - * * @param string $message + * + * @since 3.1.0 */ public function set_success( string $message ) { $this->set_message( 'success', $message ); } /** - * @since 3.1.0 - * * @param string $type * @param string $message + * + * @since 3.1.0 */ public function set_message( string $type, string $message ) { $this->_types[ $type ] = $message;