Skip to content

Commit

Permalink
Fixup: b56f3c - readability : avoid double ternary operator on the sa…
Browse files Browse the repository at this point in the history
…me line
  • Loading branch information
pthom committed Dec 2, 2024
1 parent 2a7cf9c commit be1e800
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,12 @@ def _make_adapted_lambda_code_end(adapted_function: AdaptedFunction, lambda_adap
if hasattr(adapted_function.cpp_element(), "return_type"):
_return_referenced = '&' in adapted_function.cpp_element().return_type.modifiers

auto_r_equal_or_void = ("auto" + ("&" if _return_referenced else "") + " lambda_result = ") if _fn_return_type != "void" else ""
# Fill auto_r_equal_or_void
if _fn_return_type != "void":
_auto = "auto&" if _return_referenced else "auto"
auto_r_equal_or_void = f"{_auto} lambda_result = "
else:
auto_r_equal_or_void = ""

# Fill function_or_lambda_to_call
if adapted_function.lambda_to_call is not None:
Expand Down

0 comments on commit be1e800

Please sign in to comment.