diff options
author | Ville Skyttä <ville.skytta@iki.fi> | 2011-11-07 18:32:26 +0100 |
---|---|---|
committer | Christian Wieninger <cwieninger@gmx.de> | 2011-11-07 18:32:26 +0100 |
commit | b0a0bac95adb56ba6963f70bd776e9bc66a2d15c (patch) | |
tree | 988b97b31a4dad903fb1afe98aebb57e679c0a43 | |
parent | 35ffc03c988be21424bb093893acec098f22f3b1 (diff) | |
download | vdr-plugin-epgsearch-b0a0bac95adb56ba6963f70bd776e9bc66a2d15c.tar.gz vdr-plugin-epgsearch-b0a0bac95adb56ba6963f70bd776e9bc66a2d15c.tar.bz2 |
Use empty() instead of size() to check container emptiness.
-rw-r--r-- | conflictcheck.c | 2 | ||||
-rw-r--r-- | conflictcheck.h | 2 | ||||
-rw-r--r-- | mail.c | 18 |
3 files changed, 11 insertions, 11 deletions
diff --git a/conflictcheck.c b/conflictcheck.c index 37b6c45..48b3d4d 100644 --- a/conflictcheck.c +++ b/conflictcheck.c @@ -401,7 +401,7 @@ cList<cConflictCheckTime>* cConflictCheck::CreateConflictList(cList<cConflictChe for(cConflictCheckTime* checkTime = EvalTimeList->First(); checkTime;) // clear the list { cConflictCheckTime* checkTimeNext = EvalTimeList->Next(checkTime); - if (checkTime->failedTimers.size() == 0) + if (checkTime->failedTimers.empty()) EvalTimeList->Del(checkTime); else { diff --git a/conflictcheck.h b/conflictcheck.h index f7039ba..6092936 100644 --- a/conflictcheck.h +++ b/conflictcheck.h @@ -109,7 +109,7 @@ class cConflictCheckDevice return prio; }; int CardIndex(void) const { if (device) return device->CardIndex(); else return devicenr;} - bool Receiving() const { return (recTimers.size() > 0); } + bool Receiving() const { return !recTimers.empty(); } bool IsTunedTo (const cChannel* Channel) const { for(std::set<cConflictCheckTimerObj*,TimerObjSort>::iterator it = recTimers.begin(); it != recTimers.end(); it++) @@ -374,10 +374,10 @@ void cMailUpdateNotifier::SendUpdateNotifications() p = PendingNotifications.Next(p); } - if (newTimers.size() == 0 && - modTimers.size() == 0 && - delTimers.size() == 0 && - announceEvents.size() == 0) + if (newTimers.empty() && + modTimers.empty() && + delTimers.empty() && + announceEvents.empty()) return; // extract single templates @@ -393,7 +393,7 @@ void cMailUpdateNotifier::SendUpdateNotifications() // create the timer list for new timers string newtimers; - if (newTimers.size() == 0) + if (newTimers.empty()) newtimers = tr("No new timers were added."); std::set<cMailTimerNotification>::iterator itnt; for (itnt = newTimers.begin(); itnt != newTimers.end(); itnt++) @@ -404,7 +404,7 @@ void cMailUpdateNotifier::SendUpdateNotifications() // create the timer list for modified timers string modtimers; - if (modTimers.size() == 0) + if (modTimers.empty()) modtimers = tr("No timers were modified."); std::set<cMailTimerNotification>::iterator itmt; for (itmt = modTimers.begin(); itmt != modTimers.end(); itmt++) @@ -415,7 +415,7 @@ void cMailUpdateNotifier::SendUpdateNotifications() // create the timer list for removed timers string deltimers; - if (delTimers.size() == 0) + if (delTimers.empty()) deltimers = tr("No timers were deleted."); std::set<cMailDelTimerNotification>::iterator itdt; for (itdt = delTimers.begin(); itdt != delTimers.end(); itdt++) @@ -426,7 +426,7 @@ void cMailUpdateNotifier::SendUpdateNotifications() // create the list of events to announce string announceevents; - if (announceEvents.size() == 0) + if (announceEvents.empty()) announceevents = tr("No new events to announce."); std::set<cMailAnnounceEventNotification>::iterator itae; for (itae = announceEvents.begin(); itae != announceEvents.end(); itae++) @@ -492,7 +492,7 @@ void cMailUpdateNotifier::SendUpdateNotifications() if (noAnnounce && noAnnounce->Valid()) NoAnnounces.Add(noAnnounce); } - if (announceEvents.size() > 0) + if (!announceEvents.empty()) { NoAnnounces.ClearOutdated(); NoAnnounces.Save(); |