diff options
| author | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-01-26 23:11:29 +0100 |
|---|---|---|
| committer | Georgios Andreadis <g.andreadis@student.tudelft.nl> | 2017-01-26 23:11:29 +0100 |
| commit | 027b379cf9d53a12782781e586f79051461ab661 (patch) | |
| tree | 2a7601dce3b02b8e6984a9206849b97770ae585d /src/scripts/controllers/simulation/statecache.ts | |
| parent | 45a1bdae27115974568fe8cfaff7c190d1963e28 (diff) | |
Refactor controllers to use 'const' when possible
Diffstat (limited to 'src/scripts/controllers/simulation/statecache.ts')
| -rw-r--r-- | src/scripts/controllers/simulation/statecache.ts | 8 |
1 files changed, 4 insertions, 4 deletions
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<ITickState> { - let tickState: ITickState = { + const tickState: ITickState = { tick, machineStates: [], rackStates: [], |
