Skip to content

Merge condition for more readable code #9

@monperrus

Description

@monperrus

When you have twice the same condition in the same block it can be merged:

if (a!=null) {
  a.foo();
}
somethingeslse();
if (a!=null) {
  a.bar();
}

becomes

if (a!=null) {
  a.foo();
  somethingeslse();
  a.bar();
}

(bug found with Repairnator)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions