Skip to content

Commit 58bf067

Browse files
dgrahammuan
andcommitted
Inline list index lookup
Co-authored-by: Mu-An Chiou <[email protected]>
1 parent dcbc960 commit 58bf067

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/task-lists-element.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,7 @@ function syncDisabled(list: TaskListsElement) {
187187
function listIndex(list: Element): number {
188188
const container = list.closest('task-lists')
189189
if (!container) throw new Error('parent not found')
190-
const top = Array.from(container.querySelectorAll('ol, ul'))
191-
return top.indexOf(list)
190+
return Array.from(container.querySelectorAll('ol, ul')).indexOf(list)
192191
}
193192

194193
function onSorted({src, dst}) {

0 commit comments

Comments
 (0)