move unique sort to eventlist.cpp

Origin commit data
------------------
Branch: ni/coolstream
Commit: 63cf116495
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2012-05-11 (Fri, 11 May 2012)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Jacek Jendrzej
2012-05-11 13:12:47 +02:00
parent 9e419d26a7
commit 15bc3a4f42

View File

@@ -87,6 +87,11 @@ inline static bool sortByDateTime (const CChannelEvent& a, const CChannelEvent&
return a.startTime < b.startTime;
}
inline static bool sortbyEventid (const CChannelEvent& a, const CChannelEvent& b)
{
return (a.channelID == b.channelID && a.eventID == b.eventID);
}
CNeutrinoEventList::CNeutrinoEventList()
{
frameBuffer = CFrameBuffer::getInstance();
@@ -1043,7 +1048,12 @@ bool CNeutrinoEventList::findEvents(void)
}
box.hide();
}
if(!evtlist.empty()){
sort(evtlist.begin(),evtlist.end(),sortByDateTime);
unique(evtlist.begin(), evtlist.end(),sortbyEventid);
evtlist.erase(unique(evtlist.begin(), evtlist.end(),sortbyEventid), evtlist.end());
}
current_event = (unsigned int)-1;
time_t azeit=time(NULL);