diff --git a/src/eitd/SIevents.cpp b/src/eitd/SIevents.cpp index 680e6fadc..7883d22b4 100644 --- a/src/eitd/SIevents.cpp +++ b/src/eitd/SIevents.cpp @@ -85,7 +85,7 @@ unsigned int getCountryIndex(const std::string &country) { unsigned int ix = 0; OpenThreads::ScopedLock m_lock(countryMutex); - if (!countryVector.size()) { + if (countryVector.empty()) { countryVector.push_back("DEU"); // 0 countryVector.push_back("FRA"); // 1 countryVector.push_back("ITA"); // 2 @@ -105,7 +105,7 @@ static std::map componentMap; void SIcomponent::setComponent(const std::string &component_description) { OpenThreads::ScopedLock m_lock(componentMutex); - if (!componentVector.size()) { + if (componentVector.empty()) { componentMap[""] = 0; componentVector.push_back(""); } @@ -483,7 +483,7 @@ char SIevent::getFSK() const std::string SIevent::getName() const { if (CSectionsdClient::LANGUAGE_MODE_OFF == SIlanguage::getMode()) { - if (langData.size()) + if (!langData.empty()) return langData.begin()->text[SILangData::langName]; return ""; } else { @@ -521,7 +521,7 @@ void SIevent::setName(unsigned int lang, const std::string &name) std::string SIevent::getText() const { if (CSectionsdClient::LANGUAGE_MODE_OFF == SIlanguage::getMode()) { - if (langData.size()) + if (!langData.empty()) return langData.begin()->text[SILangData::langText]; return ""; } @@ -555,7 +555,7 @@ void SIevent::setText(unsigned int lang, const std::string &text) std::string SIevent::getExtendedText() const { if (CSectionsdClient::LANGUAGE_MODE_OFF == SIlanguage::getMode()) { - if (langData.size()) + if (!langData.empty()) return langData.begin()->text[SILangData::langExtendedText]; return ""; } @@ -618,33 +618,33 @@ int SIevent::saveXML0(FILE *file) const int SIevent::saveXML2(FILE *file) const { for (std::list::const_iterator i = langData.begin(); i != langData.end(); ++i) { - if (i->text[SILangData::langName].length()) { + if (!i->text[SILangData::langName].empty()) { fprintf(file, "\t\t\tlang].c_str()); saveStringToXMLfile(file, i->text[SILangData::langName].c_str()); fprintf(file, "\"/>\n"); } } for (std::list::const_iterator i = langData.begin(); i != langData.end(); ++i) { - if (i->text[SILangData::langText].length()) { + if (!i->text[SILangData::langText].empty()) { fprintf(file, "\t\t\tlang].c_str()); saveStringToXMLfile(file, i->text[SILangData::langText].c_str()); fprintf(file, "\"/>\n"); } } #ifdef USE_ITEM_DESCRIPTION - if(item.length()) { + if(!item.empty()) { fprintf(file, "\t\t\t\n"); } - if(itemDescription.length()) { + if(!itemDescription.empty()) { fprintf(file, "\t\t\t\n"); } #endif for (std::list::const_iterator i = langData.begin(); i != langData.end(); ++i) { - if (i->text[SILangData::langExtendedText].length()) { + if (!i->text[SILangData::langExtendedText].empty()) { fprintf(file, "\t\t\tlang].c_str()); saveStringToXMLfile(file, i->text[SILangData::langExtendedText].c_str()); fprintf(file, "\"/>\n"); @@ -674,9 +674,9 @@ void SIevent::dump(void) const printf("Service-ID: %hu\n", service_id); printf("Event-ID: %hu\n", eventID); #ifdef USE_ITEM_DESCRIPTION - if(item.length()) + if(!item.empty()) printf("Item: %s\n", item.c_str()); - if(itemDescription.length()) + if(!itemDescription.empty()) printf("Item-Description: %s\n", itemDescription.c_str()); #endif for (std::list::const_iterator it = langData.begin(); it != langData.end(); ++it) { @@ -687,13 +687,13 @@ void SIevent::dump(void) const std::string contentClassification, userClassification; classifications.get(contentClassification, userClassification); - if(contentClassification.length()) { + if(!contentClassification.empty()) { printf("Content classification:"); for(unsigned i=0; i m_lock(langIndexMutex); - if (!langIndex.size()) + if (langIndex.empty()) langIndex.push_back(languageOFF); for (std::vector::iterator it = langIndex.begin(); it != langIndex.end(); ++it, ++ix) if (*it == lang) @@ -101,7 +101,7 @@ void SIlanguage::filter(const std::list& s, SILangData::SILangDataIn } } - if (retval.length() == 0) { + if (retval.empty()) { // return all available languages if (s.begin() != s.end()) { for (std::list::const_iterator it = s.begin() ; diff --git a/src/eitd/SIservices.hpp b/src/eitd/SIservices.hpp index 4d6796c0a..186a58861 100644 --- a/src/eitd/SIservices.hpp +++ b/src/eitd/SIservices.hpp @@ -140,9 +140,9 @@ public: printf("Service-ID: %hu\n", service_id); printf("Service-Typ: %hhu\n", serviceTyp); #if 0 // unused - if(providerName.length()) + if(!providerName.empty()) printf("Provider-Name: %s\n", providerName.c_str()); - if(serviceName.length()) + if(!serviceName.empty()) printf("Service-Name: %s\n", serviceName.c_str()); #endif for_each(nvods.begin(), nvods.end(), printSInvodReference()); diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index 630a38917..3573681b1 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -352,12 +352,12 @@ xprintf("addEvent: ch %012" PRIx64 " running %d (%s) got_CN %d\n", evt.get_chann si->second->item = evt.item; #endif //si->second->vps = evt.vps; - if ((evt.getExtendedText().length() > 0) && !evt.times.empty() && + if ((!evt.getExtendedText().empty()) && !evt.times.empty() && (evt.times.begin()->startzeit < zeit + secondsExtendedTextCache)) si->second->setExtendedText(0 /*"OFF"*/,evt.getExtendedText()); - if (evt.getText().length() > 0) + if (!evt.getText().empty()) si->second->setText(0 /*"OFF"*/,evt.getText()); - if (evt.getName().length() > 0) + if (!evt.getName().empty()) si->second->setName(0 /*"OFF"*/,evt.getName()); } else { @@ -2293,7 +2293,7 @@ void CEitManager::getEventsServiceKey(t_channel_id serviceUniqueKey, CChannelEve // service Found readLockEvents(); int serviceIDfound = 0; - if (search_text.length()) + if (!search_text.empty()) std::transform(search_text.begin(), search_text.end(), search_text.begin(), tolower); for (MySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey::iterator e = mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.begin(); e != mySIeventsOrderServiceUniqueKeyFirstStartTimeEventUniqueKey.end(); ++e) diff --git a/src/eitd/xmlutil.cpp b/src/eitd/xmlutil.cpp index 1baf735ba..6bd6794f3 100644 --- a/src/eitd/xmlutil.cpp +++ b/src/eitd/xmlutil.cpp @@ -426,7 +426,7 @@ void *insertEventsfromFile(void * data) node = node->xmlNextNode; } - if (contentClassification.size()) { + if (!contentClassification.empty()) { ssize_t off = e.classifications.reserve(2 * contentClassification.size()); if (off > -1) for (unsigned i = 0; i < contentClassification.size(); i++)