From e2cf59ac581fad905ee30c3abe00784a7521f1ee Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Wed, 31 Oct 2012 18:22:14 +0100 Subject: [PATCH] Bug 8997: Unnecessary call to getAllLanguages In C4/Language, getTranslatedLanguages calls getAllLanguage, passes it to _build_languages_arrayref, that does nothing of it. Removing this dead code will clean & reduce SQL overhead Signed-off-by: Jared Camins-Esakov I tried switching between languages and enabling and disabling languages, and could not see any change with the patch applied. Passed-QA-by: Jonathan Druart Signed-off-by: Jared Camins-Esakov --- C4/Languages.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/C4/Languages.pm b/C4/Languages.pm index d0eed6982e..6ecd39b385 100644 --- a/C4/Languages.pm +++ b/C4/Languages.pm @@ -119,7 +119,6 @@ Returns a reference to an array of hashes: sub getTranslatedLanguages { my ($interface, $theme, $current_language, $which) = @_; my $htdocs; - my $all_languages = getAllLanguages(); my @languages; my @enabled_languages; @@ -161,7 +160,7 @@ sub getTranslatedLanguages { $seen{$_}++ for @languages; @languages = keys %seen; } - return _build_languages_arrayref($all_languages,\@languages,$current_language,\@enabled_languages); + return _build_languages_arrayref(\@languages,$current_language,\@enabled_languages); } =head2 getAllLanguages @@ -276,7 +275,7 @@ FIXME: this could be rewritten and simplified using map =cut sub _build_languages_arrayref { - my ($all_languages,$translated_languages,$current_language,$enabled_languages) = @_; + my ($translated_languages,$current_language,$enabled_languages) = @_; my @translated_languages = @$translated_languages; my @languages_loop; # the final reference to an array of hashrefs my @enabled_languages = @$enabled_languages; -- 2.39.5