From fabe1f0e24c0cd1fadc6ec02ff9829e9695cb198 Mon Sep 17 00:00:00 2001 From: patrickhlauke Date: Sat, 13 Jul 2019 21:52:21 +0100 Subject: [PATCH] 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 --- js/src/tab.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/js/src/tab.js b/js/src/tab.js index a1f7d5afd..4146ebe1d 100644 --- a/js/src/tab.js +++ b/js/src/tab.js @@ -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() }