Skip to content

Commit

Permalink
Remove unnecessary type assertions
Browse files Browse the repository at this point in the history
The types can already be inferred with existing usage.
  • Loading branch information
victorlin committed Nov 20, 2024
1 parent 4592e2a commit 6215591
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/entropyCreateStateFromJsons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const genomeMap = (annotations: JsonAnnotations): GenomeAnnotation => {
.map(([annotationKey, annotation]) => {
const geneName = annotation.gene || annotationKey;
if (!(geneName in annotationsPerGene)) annotationsPerGene[geneName] = {};
const gene = annotationsPerGene[geneName] as JsonAnnotations; // TODO - why do I need to cast?
const gene = annotationsPerGene[geneName];
gene[annotationKey] = annotation;
})

Expand Down Expand Up @@ -167,7 +167,7 @@ function validColor(color:(string|undefined)) {
function* nextColorGenerator() {
let i=0;
while (true) {
yield genotypeColors[i++] as string;
yield genotypeColors[i++];
if (i===genotypeColors.length) i=0;
}
}
Expand Down

0 comments on commit 6215591

Please sign in to comment.