api/v0: replace one "if !" with "unless" for readability

This commit is contained in:
Lucas Gabriel Vuotto 2025-05-04 10:02:23 +00:00
parent 05c8d5e493
commit d97ee5f57c

View file

@ -31,8 +31,8 @@ sub random_id ($self)
sub get ($self, %search)
{
croak "Exactly one of 'id' or 'display' must be defined" if
!(defined($search{id}) ^^ defined($search{display}));
croak "Exactly one of 'id' or 'display' must be defined" unless
defined($search{id}) ^^ defined($search{display});
my $key = defined($search{id}) ? "id" : "display";
my $where_clause = where_in($key, $search{$key}->@*);