Skip to content

Commit

Permalink
Remove check to swap if else branch based on length
Browse files Browse the repository at this point in the history
  • Loading branch information
rihi committed Jan 10, 2024
1 parent fa50ae5 commit 50e0bbd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions decompiler/backend/codevisitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ def visit_condition_node(self, node: ast_nodes.ConditionNode) -> str:
return f"if ({self._condition_string(node.condition)}) {{{true_str}}}"
false_str = self.visit(node.false_branch_child)
if isinstance(node.true_branch_child, ast_nodes.ConditionNode) or isinstance(node.false_branch_child, ast_nodes.ConditionNode):
negate_condition = isinstance(node.true_branch_child, ast_nodes.ConditionNode) and (
not isinstance(node.false_branch_child, ast_nodes.ConditionNode) or len(false_str) > len(true_str)
negate_condition = isinstance(node.true_branch_child, ast_nodes.ConditionNode) and not isinstance(
node.false_branch_child, ast_nodes.ConditionNode
)

condition = node.condition
Expand Down

0 comments on commit 50e0bbd

Please sign in to comment.