[FFmpeg-devel] [PATCH 4/5] [FATESERVER] index: use one parameter "sort" for both ascending and descending sorting

Derek Buitenhuis derek.buitenhuis at gmail.com
Mon Jun 2 16:33:28 CEST 2014


On 6/1/2014 12:45 AM, Timothy Gu wrote:
> @@ -93,6 +93,10 @@ sub nscmp {
>  sub repcmp {
>      my $r;
>      for my $s (@sort) {
> +        if ($s =~ /desc/) {
> +            $s =~ s/desc//;

/^desc/ ?

>  sub lsort {
>      my $params = join '&', map param($_), grep $_ !~ 'sort', param;
>      $params .= '&' if $params;
> -    my ($text, $key, $p) = @_;
> -    if ($sort eq $key) {
> -        $p = param('asort') ? 'dsort' : 'asort';
> -    }
> -    if (!$p) {
> -        $p = 'asort';
> +    my ($text, $key) = @_;
> +
> +    if ($sort eq $key) {                           # $sort = $key
> +        if ($key =~ /desc/) {                      # $sort = desc*
> +            $key =~ s/desc//;

Ditto?

- Derek


More information about the ffmpeg-devel mailing list