Skip to content

Commit 2cc8795

Browse files
committed
refactor: simplify stop bit parsing
1 parent fb449aa commit 2cc8795

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

‎src/detail/posix_parse_stop_bits.hpp‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,14 @@
66

77
namespace cpp_bindings_linux::detail
88
{
9-
inline auto parseStopBits(int stop_bits, ErrorCallbackT error_callback, StatusCodeValue invalid_code,
10-
bool allow_one_alias = true) -> std::optional<StopBits>
9+
inline auto parseStopBits(int stop_bits, ErrorCallbackT error_callback, StatusCodeValue invalid_code)
10+
-> std::optional<StopBits>
1111
{
1212
switch (stop_bits)
1313
{
1414
case 0:
15-
return StopBits::kOne;
1615
case 1:
17-
if (allow_one_alias)
18-
{
19-
return StopBits::kOne;
20-
}
21-
break;
16+
return StopBits::kOne;
2217
case 2:
2318
return StopBits::kTwo;
2419
default:

0 commit comments

Comments
 (0)