aboutsummaryrefslogtreecommitdiffstats
path: root/src/queue.js
diff options
context:
space:
mode:
authorUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-05-27 23:04:21 +0200
committerUlrich-Matthias Schäfer <ulima.ums@googlemail.com>2018-05-27 23:04:21 +0200
commit6a85fb99391e73ee551e4913f9199d426ddf93c7 (patch)
treee40b4996ca54ecf57f913c54a60f3efb361b8623 /src/queue.js
parentcbf1359e0ab469e1137450192b7d612501c4bb5c (diff)
downloadsvg.js-6a85fb99391e73ee551e4913f9199d426ddf93c7.tar.gz
svg.js-6a85fb99391e73ee551e4913f9199d426ddf93c7.zip
satisfy linter
Diffstat (limited to 'src/queue.js')
-rw-r--r--src/queue.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/queue.js b/src/queue.js
index abcfb84..290de26 100644
--- a/src/queue.js
+++ b/src/queue.js
@@ -8,7 +8,6 @@ SVG.Queue = SVG.invent({
extend: {
push: function (value) {
-
// An item stores an id and the provided value
var item = { id: this.id++, value: value }
@@ -23,8 +22,8 @@ SVG.Queue = SVG.invent({
},
shift: function () {
- if (this.length == 0) {
- return
+ if (!this.length) {
+ return null
}
var remove = this._first
@@ -48,8 +47,8 @@ SVG.Queue = SVG.invent({
// Find the first match
var previous = null
var current = this._first
- while (current) {
+ while (current) {
// If we have a match, we are done
if (matcher(current)) break
@@ -59,12 +58,14 @@ SVG.Queue = SVG.invent({
}
// If we got the first item, adjust the first pointer
- if (current && current === this._first)
+ if (current && current === this._first) {
this._first = this._first.next
+ }
// If we got the last item, adjust the last pointer
- if (current && current === this._last)
+ if (current && current === this._last) {
this._last = previous
+ }
// If we got an item, fix the list and return the item
if (current) {