Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
A little optimization for the previous patch (channels playlist sorting)
  • Loading branch information
perexg committed Sep 14, 2015
1 parent fb0f13c commit 59d427d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/webui/webui.c
Expand Up @@ -83,13 +83,12 @@ http_channel_playlist_cmp(const void *a, const void *b)
{
int r;
channel_t *c1 = *(channel_t **)a, *c2 = *(channel_t **)b;
if (channel_get_number(c1) > channel_get_number(c2))
int64_t n1 = channel_get_number(c1), n2 = channel_get_number(c2);
if (n1 > n2)
r = 1;
else if (channel_get_number(c1) < channel_get_number(c2))
else if (n1 < n2)
r = -1;
else
r = 0;
if (r == 0)
r = strcasecmp(channel_get_name(c1), channel_get_name(c2));
return r;
}
Expand Down

0 comments on commit 59d427d

Please sign in to comment.