http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9659 Frédéric Demians <frederic@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |frederic@tamil.fr --- Comment #10 from Frédéric Demians <frederic@tamil.fr> --- This function is sub-optimal: sub IsAuthorisedValueCategory { my $category = shift; my $categories_arrayref = GetAuthorisedValueCategories(); foreach my $tmp_category (@$categories_arrayref) { if ( $tmp_category eq $category ) { return 1; } } return 0; } You call GetAuthorisedValueCategories which do a SELECT DISTINCT on the whole authorised values table. You may do it directly in SQL: sub IsAuthorisedValueCategory { my $sth = C4::Context->dbh->prepare( "SELECT category FROM authorised_values WHERE category=? LIMIT 1"); $sth->execute(shift); $sth->fetchrow ? 1 : 0; } -- You are receiving this mail because: You are watching all bug changes.