mirror of
https://github.com/owntone/owntone-server.git
synced 2025-07-25 08:20:11 -04:00
[web] Avoid useless assignment
This commit is contained in:
parent
938458b56e
commit
30fc35097c
@ -32,7 +32,6 @@ export default [
|
|||||||
'no-ternary': 'off',
|
'no-ternary': 'off',
|
||||||
'no-undef': 'off',
|
'no-undef': 'off',
|
||||||
'no-unused-vars': ['error', { args: 'none', caughtErrors: 'none' }],
|
'no-unused-vars': ['error', { args: 'none', caughtErrors: 'none' }],
|
||||||
'no-useless-assignment': 'off',
|
|
||||||
'one-var': 'off',
|
'one-var': 'off',
|
||||||
'prefer-named-capture-group': 'off',
|
'prefer-named-capture-group': 'off',
|
||||||
'sort-keys': 'off',
|
'sort-keys': 'off',
|
||||||
|
@ -117,25 +117,25 @@ export default {
|
|||||||
}
|
}
|
||||||
// Not found, then start a binary search
|
// Not found, then start a binary search
|
||||||
let end = la.length - 1,
|
let end = la.length - 1,
|
||||||
index = 0,
|
index = -1,
|
||||||
start = 0
|
start = 0
|
||||||
while (start <= end) {
|
while (start <= end) {
|
||||||
index = (start + end) >> 1
|
index = (start + end) >> 1
|
||||||
const currentVerse = la[index]
|
const currentVerseTime = la[index].time
|
||||||
const nextVerse = la[index + 1]
|
const nextVerseTime = la[index + 1]?.time
|
||||||
if (
|
if (
|
||||||
currentVerse.time <= currentTime &&
|
currentVerseTime <= currentTime &&
|
||||||
(nextVerse?.time > currentTime || !nextVerse)
|
(nextVerseTime > currentTime || !nextVerseTime)
|
||||||
) {
|
) {
|
||||||
return index
|
break
|
||||||
}
|
}
|
||||||
if (currentVerse.time < currentTime) {
|
if (currentVerseTime < currentTime) {
|
||||||
start = index + 1
|
start = index + 1
|
||||||
} else {
|
} else {
|
||||||
end = index - 1
|
end = index - 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1
|
return index
|
||||||
}
|
}
|
||||||
this.reset_scrolling()
|
this.reset_scrolling()
|
||||||
return -1
|
return -1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user