From 92f4872ea7b6b44881c87360b929af3f1f6b6ad1 Mon Sep 17 00:00:00 2001 From: Cade Scroggins Date: Sun, 14 Aug 2016 00:54:37 -0700 Subject: [PATCH] if/else -> ternary --- index.html | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 626d883..c748b0d 100644 --- a/index.html +++ b/index.html @@ -240,11 +240,8 @@ return false; } - if (q.match(new RegExp(urlRegex))) { - redirect = q; - } else { - redirect = config.defaultCommand + encodeURIComponent(q); - } + redirect = q.match(new RegExp(urlRegex)) ? q + : config.defaultCommand + encodeURIComponent(q); config.commands.forEach(function(command) { if (qSplit[0] === command.key) {