Skip to content

Use early return at minimax.c:23 #1

@rodikh

Description

@rodikh

Inside the file minimax.c, on line 23, you have an else.
it is not needed for the flow of the function, and the function will work exactly the same if you delete the else line of the code, and lower the rest of the function by one indentation.

i.e.

if (something) {
  return;
} else {
  doSomethingElse();
}

is exactly the same as

if (something) {
   return;
}
doSomethingElse();

This pattern is called "Early return", and it helps by making your function seem less complex by having less indentations and less if/else branching.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions