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