aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Pinkelman2016-05-02 17:56:49 -0400
committerScott Pinkelman2016-05-02 17:59:38 -0400
commit7aa53edf5776370b6da7ddfb1dae9e7017693f59 (patch)
treea57dfe206bbb191ce6637ba8213d5a7c6bc1cba2
parente347a3735d30a1a596c0b1958d584b07d79e399f (diff)
downloadvimium-7aa53edf5776370b6da7ddfb1dae9e7017693f59.tar.bz2
Removes unnecessary parentheses and makes precedence of || and && explicit
-rw-r--r--content_scripts/vimium_frontend.coffee8
1 files changed, 4 insertions, 4 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 6de17ec5..9dd68278 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -563,8 +563,8 @@ findAndFollowLink = (linkStrings) ->
linkMatches = false
for linkString in linkStrings
- if (link.innerText.toLowerCase().indexOf(linkString) != -1 || link.value &&
- link.value.indexOf(linkString) != -1)
+ if link.innerText.toLowerCase().indexOf(linkString) != -1 ||
+ link.value?.indexOf(linkString) != -1
linkMatches = true
break
continue unless linkMatches
@@ -596,8 +596,8 @@ findAndFollowLink = (linkStrings) ->
else
new RegExp linkString, "i"
for candidateLink in candidateLinks
- if (exactWordRegex.test(candidateLink.innerText) ||
- candidateLink.value && exactWordRegex.test(candidateLink.value))
+ if exactWordRegex.test(candidateLink.innerText) ||
+ (candidateLink.value && exactWordRegex.test(candidateLink.value))
followLink(candidateLink)
return true
false