Skip to content

Commit

Permalink
move a variable outside [refactoring]
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomif committed Apr 8, 2024
1 parent afe9c96 commit 621c8f9
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ my $MAX_RANK = 13;
my $NUM_SUITS = 4;
my $CARD_RE = qr/[A23456789TJQK][HCDS]/;

my %_VARIANTS = (
all_in_a_row => 1,
binary_star => 1,
black_hole => 1,
golf => 1,
);

sub _is_binary_star
{
my $self = shift;
Expand Down Expand Up @@ -125,14 +132,7 @@ sub _init
my ( $self, $args ) = @_;

my $variant = $self->_variant( $args->{variant} );
if (
not exists {
all_in_a_row => 1,
binary_star => 1,
black_hole => 1,
golf => 1,
}->{$variant}
)
if ( not exists $_VARIANTS{$variant} )
{
Carp::confess("Unknown variant '$variant'!");
}
Expand Down

0 comments on commit 621c8f9

Please sign in to comment.