Module: check_mk
Branch: master
Commit: d5b67acb1c4ada2bcaee4ae62236f6a3c7ead2d9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d5b67acb1c4ada…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Mar 16 17:27:31 2018 +0100
Stylistic change only, unifying things a bit.
Change-Id: I03851a35a9a91824c355d8e462a6906b9ee0cf22
---
livestatus/src/ListFilter.cc | 9 ++++-----
livestatus/src/StringFilter.cc | 9 ++++-----
2 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/livestatus/src/ListFilter.cc b/livestatus/src/ListFilter.cc
index ae1e664..36c6dcd 100644
--- a/livestatus/src/ListFilter.cc
+++ b/livestatus/src/ListFilter.cc
@@ -113,13 +113,12 @@ bool ListFilter::accepts(Row row, const contact *auth_user,
std::optional<std::string> ListFilter::stringValueRestrictionFor(
const std::string &column_name) const {
+ if (column_name != columnName()) {
+ return {}; // wrong column
+ }
switch (oper()) {
case RelationalOperator::greater_or_equal:
- if (column_name == columnName()) {
- return {value()};
- } else {
- return {};
- }
+ return {value()};
case RelationalOperator::equal:
case RelationalOperator::not_equal:
case RelationalOperator::matches:
diff --git a/livestatus/src/StringFilter.cc b/livestatus/src/StringFilter.cc
index 6c7415a..40a36fa 100644
--- a/livestatus/src/StringFilter.cc
+++ b/livestatus/src/StringFilter.cc
@@ -65,13 +65,12 @@ bool StringFilter::accepts(Row row, const contact * /* auth_user */,
std::optional<std::string> StringFilter::stringValueRestrictionFor(
const std::string &column_name) const {
+ if (column_name != columnName()) {
+ return {}; // wrong column
+ }
switch (oper()) {
case RelationalOperator::equal:
- if (column_name == columnName()) {
- return {value()};
- } else {
- return {};
- }
+ return {value()};
case RelationalOperator::not_equal:
case RelationalOperator::matches:
case RelationalOperator::doesnt_match: