From: gfx Date: Mon, 8 Feb 2010 07:49:41 +0000 (+0900) Subject: Reduce duplicated code X-Git-Tag: 0.50_01~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=53f661ad85292817689ae0a2ac195019764765f0;p=gitmo%2FMouse.git Reduce duplicated code --- diff --git a/lib/Mouse/Util.pm b/lib/Mouse/Util.pm index f2d4457..0359e51 100644 --- a/lib/Mouse/Util.pm +++ b/lib/Mouse/Util.pm @@ -311,15 +311,7 @@ sub english_list { } sub quoted_english_list { - return qq{'$_[0]'} if @_ == 1; - - my @items = sort @_; - - return qq{'$items[0]' and '$items[1]'} if @items == 2; - - my $tail = pop @items; - - return join q{, }, (map{ qq{'$_'} } @items), qq{and '$tail'}; + return english_list(map { qq{'$_'} } @_); } # common utilities