浏览代码

Combine !linkElement & !linkElement.href condition in isPreloadable

Alexandre Dieulot 6 年之前
父节点
当前提交
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
   }