From d2ebac3d273276bece9f40480a863a0e71d81207 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Mon, 28 Nov 2016 01:40:51 +0100 Subject: [PATCH] perf(range): generates inefficient JS --- src/components/range/range.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/range/range.ts b/src/components/range/range.ts index 6f1af1a3d9..a8b3dc43f5 100644 --- a/src/components/range/range.ts +++ b/src/components/range/range.ts @@ -579,17 +579,18 @@ export class Range extends Ion implements AfterViewInit, ControlValueAccessor, O * @private */ updateTicks() { - if (this._snaps && this._ticks) { - let ratio = this.ratio; + const ticks = this._ticks; + if (this._snaps && ticks) { + var ratio = this.ratio; if (this._dual) { - let upperRatio = this.ratioUpper; + var upperRatio = this.ratioUpper; - this._ticks.forEach(t => { + ticks.forEach(t => { t.active = (t.ratio >= ratio && t.ratio <= upperRatio); }); } else { - this._ticks.forEach(t => { + ticks.forEach(t => { t.active = (t.ratio <= ratio); }); }