Module: check_mk
Branch: master
Commit: 9b5fd51c47970e7663e71f6da8c62053fe09605a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9b5fd51c47970e…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Nov 10 09:00:00 2015 +0100
cppcheck-induced cleanup: Prefer empty() over size().
---
livestatus/src/LogCache.cc | 2 +-
livestatus/src/TableStateHistory.cc | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/livestatus/src/LogCache.cc b/livestatus/src/LogCache.cc
index 78fdb69..5248c3e 100644
--- a/livestatus/src/LogCache.cc
+++ b/livestatus/src/LogCache.cc
@@ -111,7 +111,7 @@ bool LogCache::logCachePreChecks()
{
// Do we have any logfiles (should always be the case,
// but we don't want to crash...
- if (_logfiles.size() == 0) {
+ if (_logfiles.empty()) {
logger(LOG_INFO, "Warning: no logfile found, not even %s", log_file);
return false;
}
diff --git a/livestatus/src/TableStateHistory.cc b/livestatus/src/TableStateHistory.cc
index 63c1227..ac45c4e 100644
--- a/livestatus/src/TableStateHistory.cc
+++ b/livestatus/src/TableStateHistory.cc
@@ -322,7 +322,7 @@ void TableStateHistory::answerQuery(Query *query)
// Determine initial logentry
LogEntry* entry;
_entries = _it_logs->second->getEntriesFromQuery(query, g_store->logCache(),
_since, _until, CLASSMASK_STATEHIST);
- if (_entries->size() > 0 &&_it_logs != newest_log) {
+ if (!_entries->empty() &&_it_logs != newest_log) {
_it_entries = _entries->end();
// Check last entry. If it's younger than _since -> use this logfile too
if (--_it_entries != _entries->begin()) {