mirror of
https://github.com/rofafor/vdr-plugin-iptv.git
synced 2023-10-10 13:37:03 +02:00
Performance optimization, only sort when necessary.
This commit is contained in:
parent
46a8bfa410
commit
d7e2e8d0d3
@ -3,7 +3,7 @@
|
||||
*
|
||||
* See the README file for copyright information and how to reach the author.
|
||||
*
|
||||
* $Id: statistics.c,v 1.2 2007/10/05 22:23:56 ajhseppa Exp $
|
||||
* $Id: statistics.c,v 1.3 2007/10/05 22:30:14 ajhseppa Exp $
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
@ -99,11 +99,11 @@ void cIptvDeviceStatistics::UpdateActivePids(u_short pid, long payload)
|
||||
if (mostActivePids[numberOfElements - 1].DataAmount < payload) {
|
||||
mostActivePids[numberOfElements - 1].pid = pid;
|
||||
mostActivePids[numberOfElements - 1].DataAmount = payload;
|
||||
}
|
||||
|
||||
// Re-sort
|
||||
qsort(&mostActivePids, numberOfElements, sizeof(pidStruct), SortFunc);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Streamer statistic class
|
||||
|
Loading…
Reference in New Issue
Block a user