Skip to content

Commit

Permalink
Issue #4146: Small improvement by omitting unnecessary check.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhaerter authored and svenoe committed Feb 20, 2025
1 parent b96a835 commit 665d44b
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions Kernel/Modules/AdminDynamicFieldText.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1065,20 +1065,16 @@ sub _ShowScreen {
}
elsif ( $Param{CloneFieldID} && IsArrayRefWithData( $Param{RegExList} ) ) {

if ( !$Param{RegExCounter} ) {

my $RegExCounter = 0;
for my $RegEx ( @{ $Param{RegExList} } ) {
my $RegExCounter = 0;
for my $RegEx ( @{ $Param{RegExList} } ) {

$RegExCounter++;
$Param{ 'RegEx_' . $RegExCounter } = $RegEx->{Value};
$Param{ 'CustomerRegExErrorMessage_' . $RegExCounter } = $RegEx->{ErrorMessage};
}

$Param{RegExCounter} = $RegExCounter;
$RegExCounter++;
$Param{ 'RegEx_' . $RegExCounter } = $RegEx->{Value};
$Param{ 'CustomerRegExErrorMessage_' . $RegExCounter } = $RegEx->{ErrorMessage};
}

# NOTE check is necessary because previous block potentially alters $Param{RegExCounter}
$Param{RegExCounter} = $RegExCounter;

if ( $Param{RegExCounter} ) {

REGEXENTRY:
Expand Down

0 comments on commit 665d44b

Please sign in to comment.