mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-02 02:11:04 +02:00
sectionsd.cpp:sort unique search-eventlist
Origin commit data
------------------
Commit: a227ef5f6d
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2012-05-11 (Fri, 11 May 2012)
This commit is contained in:
@@ -2176,6 +2176,17 @@ printf("SIevent size: %d\n", sizeof(SIevent));
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* was: commandAllEventsChannelID sendAllEvents */
|
/* was: commandAllEventsChannelID sendAllEvents */
|
||||||
|
inline static bool sortbyEventid (const CChannelEvent& a, const CChannelEvent& b)
|
||||||
|
{
|
||||||
|
return (a.channelID == b.channelID && a.eventID == b.eventID);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
inline static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent& b)
|
||||||
|
{
|
||||||
|
return a.startTime < b.startTime;
|
||||||
|
}
|
||||||
|
|
||||||
void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = "")
|
void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventList &eList, char search = 0, std::string search_text = "")
|
||||||
{
|
{
|
||||||
dprintf("sendAllEvents for " PRINTF_CHANNEL_ID_TYPE "\n", serviceUniqueKey);
|
dprintf("sendAllEvents for " PRINTF_CHANNEL_ID_TYPE "\n", serviceUniqueKey);
|
||||||
@@ -2233,7 +2244,11 @@ void sectionsd_getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEventL
|
|||||||
else if ( serviceIDfound )
|
else if ( serviceIDfound )
|
||||||
break; // sind nach serviceID und startzeit sortiert -> nicht weiter suchen
|
break; // sind nach serviceID und startzeit sortiert -> nicht weiter suchen
|
||||||
}
|
}
|
||||||
|
if(!eList.empty()){
|
||||||
|
sort(eList.begin(),eList.end(),sortByDateTime);
|
||||||
|
unique(eList.begin(),eList.end(),sortbyEventid);
|
||||||
|
eList.erase(unique(eList.begin(),eList.end(),sortbyEventid),eList.end());
|
||||||
|
}
|
||||||
unlockEvents();
|
unlockEvents();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user