From 027b379cf9d53a12782781e586f79051461ab661 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Thu, 26 Jan 2017 23:11:29 +0100 Subject: Refactor controllers to use 'const' when possible --- src/scripts/controllers/simulation/statecache.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/scripts/controllers/simulation/statecache.ts') diff --git a/src/scripts/controllers/simulation/statecache.ts b/src/scripts/controllers/simulation/statecache.ts index 06dbd424..19fe0d8f 100644 --- a/src/scripts/controllers/simulation/statecache.ts +++ b/src/scripts/controllers/simulation/statecache.ts @@ -73,7 +73,7 @@ export class StateCache { } private cache(): void { - let tick = this.lastCachedTick + 1; + const tick = this.lastCachedTick + 1; this.updateLastTick().then(() => { // Check if end of simulated region has been reached @@ -85,7 +85,7 @@ export class StateCache { this.stateList = data; // Determine last cached tick - let ticks = Object.keys(this.stateList).sort((a, b) => { + const ticks = Object.keys(this.stateList).sort((a, b) => { return parseInt(a) - parseInt(b); }); if (ticks.length > 0) { @@ -209,7 +209,7 @@ export class StateCache { ); return Promise.all(promises).then(() => { - let tickStates: {[key: number]: ITickState} = {}; + const tickStates: {[key: number]: ITickState} = {}; machineStates.forEach((machineState: IMachineState) => { if (tickStates[machineState.tick] === undefined) { @@ -269,7 +269,7 @@ export class StateCache { } private fetchAllStatesOfTick(tick: number): Promise { - let tickState: ITickState = { + const tickState: ITickState = { tick, machineStates: [], rackStates: [], -- cgit v1.2.3