Просмотр исходного кода

Combine !linkElement & !linkElement.href condition in isPreloadable

Alexandre Dieulot 6 лет назад
Родитель
Сommit
1c527d9059
1 измененных файлов с 1 добавлено и 5 удалено
  1. 1 5
      instantpage.js

+ 1 - 5
instantpage.js

@@ -81,11 +81,7 @@ function mouseoutListener(event) {
 }
 
 function isPreloadable(linkElement) {
-  if (!linkElement) {
-    return
-  }
-
-  if (!linkElement.href) {
+  if (!linkElement || !linkElement.href) {
     return
   }