Skip to content

Commit ef2adb1

Browse files
author
Ivan Baidakou
committed
Further simplification
1 parent 2ebcb09 commit ef2adb1

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

include/bredis/impl/protocol.ipp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,7 @@ struct unwrap_count_t
189189
using positive_input_t =
190190
parse_result_mapper_t<Iterator, parsing_policy::keep_result>;
191191

192-
wrapped_result_t operator()(const not_enough_data_t &value) const {
193-
return wrapped_result_t{negative_result_t{value}};
194-
}
195-
196-
wrapped_result_t operator()(const protocol_error_t &value) const {
192+
template <typename T> wrapped_result_t operator()(const T &value) const {
197193
return wrapped_result_t{negative_result_t{value}};
198194
}
199195

@@ -237,9 +233,8 @@ template <typename Iterator, typename Policy> struct string_parser_t {
237233
return not_enough_data_t{};
238234
}
239235

240-
size_t consumed = already_consumed +
241-
std::distance(from, found_terminator) +
242-
terminator.size;
236+
size_t consumed = already_consumed + terminator.size +
237+
std::distance(from, found_terminator);
243238
return helper::markup_string(consumed, from, found_terminator);
244239
}
245240
};

0 commit comments

Comments
 (0)