Skip to content

Commit

Permalink
Simplify code for assigning config values
Browse files Browse the repository at this point in the history
  • Loading branch information
Martchus committed Sep 18, 2024
1 parent db10f2d commit 4b4ed38
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/OpenQA/Setup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -247,10 +247,7 @@ sub read_config ($app) {
}
for my $k (@known_keys) {
my $v = $cfg && $cfg->val($section, $k);
$v
//= exists $mode_defaults{$app->mode}{$section}->{$k}
? $mode_defaults{$app->mode}{$section}->{$k}
: $defaults{$section}->{$k};
$v //= $mode_defaults{$app->mode}{$section}->{$k} // $defaults{$section}->{$k};
$config->{$section}->{$k} = trim $v if defined $v;
}
}
Expand Down

0 comments on commit 4b4ed38

Please sign in to comment.