From f29ad0e7440db08287b4f703247417550fb7affa Mon Sep 17 00:00:00 2001 From: Christian Wieninger Date: Wed, 19 May 2010 20:43:52 +0200 Subject: small speed improvement --- epgsearchext.c | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/epgsearchext.c b/epgsearchext.c index 0df32ab..26ff95a 100644 --- a/epgsearchext.c +++ b/epgsearchext.c @@ -877,12 +877,6 @@ cEvent * cSearchExt::GetEventBySearchExt(const cSchedule *schedules, const cEven break; } - if (szTest) - { - free(szTest); - szTest = NULL; - } - if (skipRunningEvents && tNow > p->StartTime()) continue; @@ -890,15 +884,8 @@ cEvent * cSearchExt::GetEventBySearchExt(const cSchedule *schedules, const cEven if (!p->Title() || !*p->Title()) continue; - msprintf(&szTest, "%s%s%s%s%s", (useTitle?(p->Title()?p->Title():""):""), (useSubtitle||useDescription)?"~":"", - (useSubtitle?(p->ShortText()?p->ShortText():""):""),useDescription?"~":"", - (useDescription?(p->Description()?p->Description():""):"")); - if (tNow < p->EndTime() + (inspectTimerMargin?(MarginStop * 60):0)) { - if (!useCase) - ToLower(szTest); - if (useTime) { time_t tEvent = p->StartTime(); @@ -964,11 +951,21 @@ cEvent * cSearchExt::GetEventBySearchExt(const cSchedule *schedules, const cEven } } - if (*szTest) + msprintf(&szTest, "%s%s%s%s%s", (useTitle?(p->Title()?p->Title():""):""), (useSubtitle||useDescription)?"~":"", + (useSubtitle?(p->ShortText()?p->ShortText():""):""),useDescription?"~":"", + (useDescription?(p->Description()?p->Description():""):"")); + + if (!useCase) + ToLower(szTest); + + if (szTest && *szTest) { if (!MatchesSearchMode(szTest, searchText, mode," ,;|~", fuzzyTolerance)) continue; } + if (szTest) + free(szTest); + szTest = NULL; if (useExtEPGInfo && !MatchesExtEPGInfo(p)) continue; @@ -976,8 +973,6 @@ cEvent * cSearchExt::GetEventBySearchExt(const cSchedule *schedules, const cEven break; } } - if (szTest) - free(szTest); free(searchText); return pe; } -- cgit v1.2.3