Skip to content

Conversation

kevinresol
Copy link
Contributor

@kevinresol kevinresol commented Nov 9, 2018

Here I only updated some classes that I have been working on in the previous PR.

However, actually repetitive/redundant code are quite widespread in the repo, not sure if it worth a fix though, especially when there are no unit tests exist.

Here are some examples:

  1. var and function are by default private unless explicitly declared public, so private var x can be simply written as var x
  2. public override function: the accessor (public/private) can be omitted if it is unchanged vs the super one
  3. == true is redundant and == false can be replaced by prefix ! unless the bool value is nullable.
  4. Repetitive safe casts cast(value, TheType). Note that safe casts have runtime performance impact. If the type are known at compile time, unsafe casts will be more suitable var v:TheType = cast value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant