From 09bd2c98e9c875db8f5776c63d9f0e983dce913a Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 3 Jun 2013 21:37:47 +0200 Subject: [PATCH] CEitManager::getEventsServiceKey - simplification - THX Gaucho316 --- src/eitd/sectionsd.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 46dbd5fb0..9e5c7497c 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -2257,27 +2257,23 @@ void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEve bool copy = true; if(search){ - if((search == 1) || (search == 5)) {//SEARCH_EPG_TITLE == 1 SEARCH_EPG_ALL == 5 defined in eventlist.h + if ((search == 1 /*EventList::SEARCH_EPG_TITLE*/) || (search == 5 /*EventList::SEARCH_EPG_ALL*/)) + { std::string eName = (*e)->getName(); std::transform(eName.begin(), eName.end(), eName.begin(), tolower); - if(eName.find(search_text) == std::string::npos) - copy = false; + copy = (eName.find(search_text) != std::string::npos); } - if((search == 2) || (!copy && search == 5)) {//SEARCH_EPG_INFO1 == 2 + if ((search == 2 /*EventList::SEARCH_EPG_INFO1*/) || (!copy && (search == 5 /*EventList::SEARCH_EPG_ALL*/))) + { std::string eText = (*e)->getText(); std::transform(eText.begin(), eText.end(), eText.begin(), tolower); - if(eText.find(search_text) == std::string::npos) - copy = false; - else if(search == 5) - copy = true; + copy = (eText.find(search_text) != std::string::npos); } - if((search == 3) || (!copy && search == 5)) {//SEARCH_EPG_INFO2 == 3 + if ((search == 3 /*EventList::SEARCH_EPG_INFO2*/) || (!copy && (search == 5 /*EventList::SEARCH_EPG_ALL*/))) + { std::string eExtendedText = (*e)->getExtendedText(); std::transform(eExtendedText.begin(), eExtendedText.end(), eExtendedText.begin(), tolower); - if(eExtendedText.find(search_text) == std::string::npos) - copy = false; - else if(search == 5) - copy = true; + copy = (eExtendedText.find(search_text) != std::string::npos); } } if(copy) {