Module: check_mk
Branch: master
Commit: 814901e5f504e0d087e12f0689aa835cc33341ff
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=814901e5f504e0…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Feb 2 15:48:35 2016 +0100
clang-tidy fixes for readability-container-size-empty check.
---
livestatus/src/AndingFilter.cc | 2 +-
livestatus/src/Query.cc | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/livestatus/src/AndingFilter.cc b/livestatus/src/AndingFilter.cc
index cfeacbf..4f5b783 100644
--- a/livestatus/src/AndingFilter.cc
+++ b/livestatus/src/AndingFilter.cc
@@ -38,7 +38,7 @@ AndingFilter::~AndingFilter() {
void AndingFilter::addSubfilter(Filter *f) { _subfilters.push_back(f); }
Filter *AndingFilter::stealLastSubfiler() {
- if (_subfilters.size() == 0)
+ if (_subfilters.empty())
return 0;
else {
Filter *l = _subfilters.back();
diff --git a/livestatus/src/Query.cc b/livestatus/src/Query.cc
index 1fe7faf..e90fc5e 100644
--- a/livestatus/src/Query.cc
+++ b/livestatus/src/Query.cc
@@ -205,7 +205,7 @@ void Query::setError(int error_code, const char *msg) {
_output->setError(error_code, msg);
}
-bool Query::hasNoColumns() { return _columns.size() == 0 && !doStats(); }
+bool Query::hasNoColumns() { return _columns.empty() && !doStats(); }
int Query::lookupOperator(const char *opname) {
int opid;
@@ -334,7 +334,7 @@ void Query::parseStatsAndOrLine(char *line, int andor) {
AndingFilter *anding =
(andor == ANDOR_OR) ? new OringFilter() : new AndingFilter();
while (number > 0) {
- if (_stats_columns.size() == 0) {
+ if (_stats_columns.empty()) {
_output->setError(
RESPONSE_CODE_INVALID_HEADER,
"Invalid count for Stats%s: too few Stats: headers available",
@@ -366,7 +366,7 @@ void Query::parseStatsNegateLine(char *line) {
"StatsNegate: does not take any arguments");
return;
}
- if (_stats_columns.size() == 0) {
+ if (_stats_columns.empty()) {
_output->setError(RESPONSE_CODE_INVALID_HEADER,
"StatsNegate: no Stats: headers available");
return;
@@ -782,7 +782,7 @@ void Query::parseLocaltimeLine(char *line) {
}
}
-bool Query::doStats() { return _stats_columns.size() > 0; }
+bool Query::doStats() { return !_stats_columns.empty(); }
void Query::start() {
doWait();
@@ -796,7 +796,7 @@ void Query::start() {
// Aggregators,
// directly in _stats_aggregators. When grouping the rows of aggregators
// will be created each time a new group is found.
- if (_columns.size() == 0) {
+ if (_columns.empty()) {
_stats_aggregators = new Aggregator *[_stats_columns.size()];
for (unsigned i = 0; i < _stats_columns.size(); i++)
_stats_aggregators[i] = _stats_columns[i]->createAggregator();
@@ -873,7 +873,7 @@ bool Query::processDataset(void *data) {
Aggregator **aggr;
// When doing grouped stats, we need to fetch/create a row
// of aggregators for the current group
- if (_columns.size() > 0) {
+ if (!_columns.empty()) {
_stats_group_spec_t groupspec;
computeStatsGroupSpec(groupspec, data);
aggr = getStatsGroup(groupspec);
@@ -907,7 +907,7 @@ bool Query::processDataset(void *data) {
void Query::finish() {
// grouped stats
- if (doStats() && _columns.size() > 0) {
+ if (doStats() && !_columns.empty()) {
// output values of all stats groups (output has been post poned until
// now)
for (_stats_groups_t::iterator it = _stats_groups.begin();