sectionsd: optimize the slow_addevent case a bit more

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1475 e54a6e83-5905-42d5-8d5c-058d10e6a962


Origin commit data
------------------
Branch: ni/coolstream
Commit: 2fbbef4e34
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2011-05-16 (Mon, 16 May 2011)



------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2011-05-15 23:53:27 +00:00
parent 45c9a2685b
commit 7d42c4fc6d

View File

@@ -913,24 +913,24 @@ if (slow_addevent)
event_id_t e_key = e->uniqueKey();
t_channel_id e_chid = e->get_channel_id();
time_t start_time = e->times.begin()->startzeit;
bool found = false;
/* experiments have shown that iterating backwards here is much faster */
/* create an event that's surely behind the one to check in the sort order */
SIevent *fptr = new SIevent(evt);
fptr->eventID = 0xFFFF; /* lowest order sort criteria is eventID */
SIeventPtr f(fptr);
/* returns an iterator that's behind 'f' */
MySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey::iterator x =
mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.end();
mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.upper_bound(f);
/* the first decrement of the iterator gives us an event that's a potential
* match *or* from a different channel, then no event for this channel is stored */
while (x != mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.begin())
{
x--;
if ((*x)->get_channel_id() != e_chid)
{
/* sorted by service id first */
if (found)
break;
}
else
{
event_id_t x_key = (*x)->uniqueKey();
found = true;
/* do we need this check? */
if (x_key == e_key)
continue;