From 23cbd0f90bedc9181d55fef38708ed6d952cfbce Mon Sep 17 00:00:00 2001 From: Paul Poulain Date: Wed, 31 Oct 2012 18:22:14 +0100 Subject: [PATCH] Bug 8997: 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 --- C4/Languages.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/C4/Languages.pm b/C4/Languages.pm index d0eed69..6ecd39b 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; -- 1.7.9.5