[mb-commits] branch, beta, updated. MBS-4108: actually sort the list *at all*

MusicBrainz Git Server <[email protected]>
Newsgroups gmane.comp.audio.musicbrainz.cvs
Message-ID <E1Tdqgi-0001Ve-4H@wiley>
The branch, beta has been updated
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=e2ff2237d0424a7edb6755bbe4ffd0dca9da61c9 (commit)
      from  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=b524e5378a1896e517017bf517eb175a7c36d82d (commit)

Summary of changes:
 .../Server/Controller/Role/WikipediaExtract.pm     |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit e2ff2237d0424a7edb6755bbe4ffd0dca9da61c9
Author: Ian McEwen <[email protected]>
Date:   Wed Nov 28 16:04:40 2012 -0700

    MBS-4108: actually sort the list *at all*

diff --git a/lib/MusicBrainz/Server/Controller/Role/WikipediaExtract.pm b/lib/MusicBrainz/Server/Controller/Role/WikipediaExtract.pm
index 0286788..906ab59 100644
--- a/lib/MusicBrainz/Server/Controller/Role/WikipediaExtract.pm
+++ b/lib/MusicBrainz/Server/Controller/Role/WikipediaExtract.pm
@@ -1,5 +1,6 @@
 package MusicBrainz::Server::Controller::Role::WikipediaExtract;
 use Moose::Role -traits => 'MooseX::MethodAttributes::Role::Meta::Role';
+use List::UtilsBy qw( sort_by );
 use namespace::autoclean;
 
 after show => sub {
@@ -28,11 +29,8 @@ sub _get_extract
 
     my ($wp_link) = map {
             $_->target;
-        } reverse sort {
-            if (defined $_) {
-                my $l = $_->target;
-                $l->language eq $wanted_lang;
-            }
+        } reverse sort_by {
+            $_->target->language eq $wanted_lang
         } @{ $entity->relationships_by_link_type_names('wikipedia') };
 
     if ($wp_link) {

-----------------------------------------------------------------------


hooks/post-receive
-- 
mb_server
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.