Skip to content

Commit

Permalink
Removes unnecessary parentheses and makes precedence of || and && exp…
Browse files Browse the repository at this point in the history
…licit
  • Loading branch information
sco-tt committed May 2, 2016
1 parent e347a37 commit 7aa53ed
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions content_scripts/vimium_frontend.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7aa53ed

Please sign in to comment.