Skip to content

Commit 42e8a4e

Browse files
committed
perf: Very slightly lower footprint
1 parent 871b245 commit 42e8a4e

File tree

6 files changed

+13
-26
lines changed

6 files changed

+13
-26
lines changed

dev/components/components/data-table.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,7 @@ export default {
146146
}
147147
},
148148
beforeDestroy () {
149-
if (this.timeout) {
150-
clearTimeout(this.timeout)
151-
}
149+
clearTimeout(this.timeout)
152150
},
153151
data () {
154152
return {

src/components/toast/Toast.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,8 @@ export default {
111111
},
112112
dismiss (done) {
113113
this.active = false
114-
115-
if (this.timer) {
116-
clearTimeout(this.timer)
117-
this.timer = null
118-
}
114+
clearTimeout(this.timer)
115+
this.timer = null
119116
120117
setTimeout(() => {
121118
if (typeof this.stack[0].onDismiss === 'function') {

src/vue-components/ajax-bar/AjaxBar.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ export default {
152152
if (this.calls > 0) {
153153
return
154154
}
155-
if (this.timer) {
156-
clearTimeout(this.timer)
157-
}
155+
156+
clearTimeout(this.timer)
157+
158158
if (!this.animate) {
159159
this.active = false
160160
return
@@ -178,9 +178,7 @@ export default {
178178
highjackAjax(this.start, this.stop)
179179
},
180180
beforeDestroy () {
181-
if (this.timer) {
182-
clearTimeout(this.timer)
183-
}
181+
clearTimeout(this.timer)
184182
restoreAjax()
185183
}
186184
}

src/vue-components/context-menu/ContextMenuMobile.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,8 @@ export default {
4949
}
5050
this.cleanup = () => {
5151
this.target.classList.remove('non-selectable')
52-
if (this.touchTimer) {
53-
clearTimeout(this.touchTimer)
54-
this.touchTimer = null
55-
}
52+
clearTimeout(this.touchTimer)
53+
this.touchTimer = null
5654
}
5755
this.target.addEventListener('touchstart', this.touchStartHandler)
5856
this.target.addEventListener('touchcancel', this.cleanup)

src/vue-components/datetime/InlineDatetimeIOS.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,8 @@ export default {
443443
}
444444
},
445445
__dragCleanup () {
446-
if (this.timeout) {
447-
clearTimeout(this.timeout)
448-
this.timeout = null
449-
}
446+
clearTimeout(this.timeout)
447+
this.timeout = null
450448
},
451449
__normalizeValue (value) {
452450
if (this.pmin) {

src/vue-directives/touch-hold.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,8 @@ export default {
2525
ctx.start(evt)
2626
},
2727
abort (evt) {
28-
if (ctx.timer) {
29-
clearTimeout(ctx.timer)
30-
ctx.timer = null
31-
}
28+
clearTimeout(ctx.timer)
29+
ctx.timer = null
3230
},
3331
mouseAbort (evt) {
3432
document.removeEventListener('mousemove', ctx.mouseAbort)

0 commit comments

Comments
 (0)