Skip to content

Commit

Permalink
chore(userspace/libsinsp): remove useless ASSERTs from filter_compare
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Dellaluce <[email protected]>
  • Loading branch information
jasondellaluce authored and poiana committed May 16, 2024
1 parent 6f774a4 commit a82cc16
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions userspace/libsinsp/filter_compare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ cmpop str_to_cmpop(std::string_view str)
return CO_IGLOB;
}

ASSERT(false);
throw sinsp_exception("unrecognized filter comparison operator '" + std::string(str) + "'");
}

Expand Down Expand Up @@ -218,7 +217,6 @@ static inline bool flt_is_comparable_numeric(cmpop op, std::string& err)
case CO_EXISTS:
return true;
default:
ASSERT(false);
std::string opname;
cmpop_to_str(op, opname);
err = "'" + opname + "' operator not supported for numeric filters";
Expand All @@ -237,7 +235,6 @@ static inline bool flt_is_comparable_bool(cmpop op, std::string& err)
case CO_EXISTS:
return true;
default:
ASSERT(false);
std::string opname;
cmpop_to_str(op, opname);
err = "'" + opname + "' operator not supported for numeric filters";
Expand Down Expand Up @@ -267,7 +264,6 @@ static inline bool flt_is_comparable_string(cmpop op, std::string& err)
case CO_IGLOB:
return true;
default:
ASSERT(false);
std::string opname;
cmpop_to_str(op, opname);
err = "'" + opname + "' operator not supported for string filters";
Expand All @@ -291,7 +287,6 @@ static inline bool flt_is_comparable_buffer(cmpop op, std::string& err)
case CO_BSTARTSWITH:
return true;
default:
ASSERT(false);
std::string opname;
cmpop_to_str(op, opname);
err = "'" + opname + "' operator not supported for buffer filters";
Expand All @@ -310,7 +305,6 @@ static inline bool flt_is_comparable_ip_or_net(cmpop op, std::string& err)
case CO_INTERSECTS:
return true;
default:
ASSERT(false);
std::string opname;
cmpop_to_str(op, opname);
err = "'" + opname + "' operator not supported for ip address and network filters";
Expand All @@ -327,7 +321,6 @@ static inline bool flt_is_comparable_any_list(cmpop op, std::string& err)
case CO_INTERSECTS:
return true;
default:
ASSERT(false);
std::string opname;
cmpop_to_str(op, opname);
err = "'" + opname + "' operator not supported list filters";
Expand Down Expand Up @@ -403,7 +396,6 @@ bool flt_is_comparable(cmpop op, ppm_param_type t, bool is_list, std::string& er
case PT_BYTEBUF:
return flt_is_comparable_buffer(op, err);
default:
ASSERT(false);
std::string opname;
cmpop_to_str(op, opname);
err = "'" + opname + "' operator not supported for type '" + std::string(param_type_to_string(t)) + "'";
Expand Down

0 comments on commit a82cc16

Please sign in to comment.