Skip to content

Commit

Permalink
refactor: remove some unnecessary array spread operators
Browse files Browse the repository at this point in the history
Slice already makes a shallow copy, the spread was unnecessary. Shouldn't change functionality
  • Loading branch information
mgreminger committed Nov 12, 2023
1 parent b05e211 commit c4a019d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/parser/LatexToSympy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,12 +734,12 @@ export class LatexToSympy extends LatexParserVisitor<string | Statement | UnitBl
type: "assignment",
name: name,
sympy: sympyExpression,
implicitParams: [...this.implicitParams.slice(implicitParamsCursor)],
params: [...this.params.slice(paramsCursor)],
exponents: [...this.exponents.slice(exponentsCursor)],
functions: [...this.functions.slice(functionsCursor)],
arguments: [...this.arguments.slice(argumentsCursor)],
localSubs: [...this.localSubs.slice(localSubsCursor)],
implicitParams: this.implicitParams.slice(implicitParamsCursor),
params: this.params.slice(paramsCursor),
exponents: this.exponents.slice(exponentsCursor),
functions: this.functions.slice(functionsCursor),
arguments: this.arguments.slice(argumentsCursor),
localSubs: this.localSubs.slice(localSubsCursor),
isExponent: false,
isFunctionArgument: false,
isFunction: false,
Expand Down Expand Up @@ -920,7 +920,7 @@ export class LatexToSympy extends LatexParserVisitor<string | Statement | UnitBl
type: "assignment",
name: exponentVariableName,
sympy: exponent,
params: [...this.params.slice(cursor)],
params: this.params.slice(cursor),
isExponent: true,
isFunctionArgument: false,
isFunction: false,
Expand Down Expand Up @@ -956,11 +956,11 @@ export class LatexToSympy extends LatexParserVisitor<string | Statement | UnitBl
type: "assignment",
name: argumentName,
sympy: expression,
params: [...this.params.slice(paramCursor)],
params: this.params.slice(paramCursor),
isExponent: false,
isFunctionArgument: true,
isFunction: false,
exponents: [...this.exponents.slice(exponentCursor)]
exponents: this.exponents.slice(exponentCursor)
});

newSubs.push({
Expand Down Expand Up @@ -1013,8 +1013,8 @@ export class LatexToSympy extends LatexParserVisitor<string | Statement | UnitBl
unitQueryArgument.sympy = this.getUnitlessImplicitParam();
}

unitQueryArgument.params = [...this.params.slice(initialParamCursor)];
unitQueryArgument.exponents = [...this.exponents.slice(initialExponentCursor)];
unitQueryArgument.params = this.params.slice(initialParamCursor);
unitQueryArgument.exponents = this.exponents.slice(initialExponentCursor);

this.arguments.push(unitQueryArgument);

Expand Down

0 comments on commit c4a019d

Please sign in to comment.