charite/jannovar

Code optimization suggestions

Opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
private field can be replaced by a local variable

Describe the solution you'd like
private field can be replaced by a local variable

Describe alternatives you've considered
private field can be replaced by a local variable

Additional context
Hi,

I find that the private field iupac at Line 28 in the file 'jannovar/jannovar-hgvs/src/main/java/de/charite/compbio/jannovar/hgvs/Translator.java ' on the main branch is only assigned and used in the method initializeMaps . Therefore, this field can be removed from the class, and become a local variable in the method initializeMaps. This transformation will normally reduce memory usage and improve readability of your code.I will be happy if this transformation is helpful.

private ImmutableMap<String, String> iupac = null; // line 28 this field can be replaced by local variable

private void initializeMaps() {
  	...
    //   ImmutableMap<String, String> iupac = iupac.build();
    this.iupac = iupac.build(); // line 315
}