Skip to content

Commit

Permalink
Cosmetics
Browse files Browse the repository at this point in the history
  • Loading branch information
rschu1ze committed Apr 15, 2024
1 parent 8c9f89a commit 3db2cbe
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Functions/parseDateTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,6 @@ namespace

/// Make datetime fit in a cache line.
alignas(64) DateTime<error_handling> datetime;
/// Catching and ignoring exceptions after throwing them in the loop below is prohibited can cause serious concurrency performance issues.
/// Use tl::expected to handle the error situation.
/// Usage reference https://en.cppreference.com/w/cpp/utility/expected
for (size_t i = 0; i < input_rows_count; ++i)
{
datetime.reset();
Expand All @@ -607,7 +604,11 @@ namespace

for (const auto & instruction : instructions)
{
if (auto result = instruction.perform(cur, end, datetime); !result.has_value())
if (auto result = instruction.perform(cur, end, datetime); result.has_value())
{
cur = *result;
}
else
{
if constexpr (error_handling == ErrorHandling::Zero)
{
Expand All @@ -625,11 +626,10 @@ namespace
else
{
static_assert(error_handling == ErrorHandling::Exception);
throw Exception(result.error().error_code, "{}", result.error().error_message);
const ErrorCodeAndMessage & err = result.error();
throw Exception(err.error_code, "{}", err.error_message);
}
}
else
cur = *result;
}

if (error)
Expand Down

0 comments on commit 3db2cbe

Please sign in to comment.