Bug 31333: (QA follow-up) Simplify code
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 5 Oct 2022 18:14:22 +0000 (15:14 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 5 Oct 2022 19:01:06 +0000 (16:01 -0300)
commit8d2d63f7ae0f1da9e5ccd796a5dc7f0ba90ea93a
treedde19c1adea6b464ffc96d4537962dddda99eb15
parentd08cd5965d592073b671e9011ae060294aec786b
Bug 31333: (QA follow-up) Simplify code

The new syspref is a deny-list. So not being part of the list means you
are allowed. This was not that clear reading the code, so this patch
tries to simplify the logic. Better handling on undef syspref value is
added as well to avoid useless warnings.

This patch does the following changes:
- Uses `any` instead of `grep`. This has the effect of just returning a
  boolean on the first match, instead of keep looping until de array

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Koha/Patron/Category.pm