Skip to content

3 strange code fragments #103

Description

@j-mattsson

(I don't have any experience with this codebase so maybe these are not bugs.)

  1. } if (unit.isAtLocation(destination)) {

    The formatting is strange, the if-statement start on same line as a closing brace, is an else missing before the if? If no else is missing then the if-statement should probably moved to a line of its own.
  2. if (expert != null
    && u.getUnitChange(UnitChangeType.EXPERIENCE, expert) != null) {
    score += 10000;
    } else if (expert != null
    && u.getUnitChange(UnitChangeType.EXPERIENCE, expert) != null) {
    score -= 10000;
    }

    The two if-statements have the same condition.
  3. / ((tcb.getBottomRightDirtyTile().getX()-tcb.getTopLeftDirtyTile().getX()) * (tcb.getBottomRightDirtyTile().getY()-tcb.getBottomRightDirtyTile().getY()));

    Identical expressions (tcb.getBottomRightDirtyTile().getY()) on both sides of subtraction operator.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions