Remove redundant sanity checks

unnecessary, as these checks should never fail (since the handler would not be called if there weren't any tabs, and the `index > 0` clause in the preceding `if` ensures that `index` will never be negative
This commit is contained in:
patrickhlauke 2019-07-13 21:52:21 +01:00
parent 1687b77a48
commit fabe1f0e24

View file

@ -245,10 +245,6 @@ class Tab {
const tabs = makeArray(SelectorEngine.find(Selector.DATA_TOGGLE, tablist))
if (!tabs.length) {
return
}
let index = tabs.indexOf(event.target)
const tabInstance = Data.getData(tabs[index], DATA_KEY) || new Tab(tabs[index])
@ -266,10 +262,6 @@ class Tab {
index++
}
if (index < 0) {
index = 0
}
tabs[index].focus()
tabs[index].click()
}