diff --git a/cql3/statements/request_validations.hh b/cql3/statements/request_validations.hh index 6449ce6319..0b1f20ddc8 100644 --- a/cql3/statements/request_validations.hh +++ b/cql3/statements/request_validations.hh @@ -13,8 +13,6 @@ #include "exceptions/exceptions.hh" #include -#include - #include namespace cql3 { @@ -48,37 +46,6 @@ invalid_request(fmt::format_string message_template, MessageArgs } } - /** - * Checks that the specified list does not contains duplicates. - * - * @param list the list to test - * @param message The error message - * @throws InvalidRequestException if the specified list contains duplicates. - */ - template - void check_contains_no_duplicates(const std::vector& list, fmt::format_string<> message) { - if (std::set(list.begin(), list.end()).size() != list.size()) { - throw invalid_request(message); - } - } - - /** - * Checks that the specified list contains only the specified elements. - * - * @param list the list to test - * @param expected_elements the expected elements - * @param message the error message - * @throws InvalidRequestException if the specified list contains duplicates. - */ - template - void check_contains_only(const std::vector& list, - const std::vector& expected_elements, - fmt::format_string<> message) { - if (boost::count_if(list, [&] (const E& e) { return !boost::count_if(expected_elements, e); })) { - throw invalid_request(message); - } - } - /** * Checks that the specified expression is false. If not an InvalidRequestException will * be thrown. @@ -111,22 +78,6 @@ invalid_request(fmt::format_string message_template, MessageArgs return object; } - /** - * Checks that the specified object is null. - * If it is not an InvalidRequestException will be throws. - * - * @param object the object to test - * @param message_template the template used to build the error message - * @param message_args the message arguments - * @return the object - * @throws InvalidRequestException if the specified object is not null. - */ - template - T check_null(T object, fmt::format_string message_template, MessageArgs&&... message_args) { - check_true(!bool(object), message_template, std::forward(message_args)...); - return object; - } - /** * Returns an InvalidRequestException with the specified message. *