Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRY a bit #241

Open
wants to merge 1 commit into
base: new-component-method
Choose a base branch
from
Open

DRY a bit #241

wants to merge 1 commit into from

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.

None yet

1 participant