Selaa lähdekoodia

use ternary operator

Gildas 6 vuotta sitten
vanhempi
sitoutus
14aa62b04c
1 muutettua tiedostoa jossa 1 lisäystä ja 6 poistoa
  1. 1 6
      lib/single-file/modules/css-matched-rules.js

+ 1 - 6
lib/single-file/modules/css-matched-rules.js

@@ -135,13 +135,8 @@ this.matchedRules = this.matchedRules || (() => {
 	}
 
 	function getMatchedElementsSelector(doc, selectorInfo, styles, matchedElementsCache) {
-		let selectorText;
 		const filteredSelectorText = getFilteredSelector(selectorInfo.selector, selectorInfo.selectorText);
-		if (filteredSelectorText != selectorInfo.selectorText) {
-			selectorText = filteredSelectorText;
-		} else {
-			selectorText = selectorInfo.selectorText;
-		}
+		const selectorText = filteredSelectorText != selectorInfo.selectorText ? filteredSelectorText : selectorInfo.selectorText;
 		const cachedMatchedElements = matchedElementsCache.get(selectorText);
 		let matchedElements = cachedMatchedElements;
 		if (!matchedElements) {