From daf49a0089b9f5e342d3f6ee077d7e284eeb5c1c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 13 Jan 2015 22:43:21 -0800 Subject: blocks.js - avoid an implicit boolean cast. --- js/lib/blocks.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/lib') diff --git a/js/lib/blocks.js b/js/lib/blocks.js index 86064b5..d53a82f 100644 --- a/js/lib/blocks.js +++ b/js/lib/blocks.js @@ -65,10 +65,10 @@ var detabLine = function(text) { // Return index of match or -1. var matchAt = function(re, s, offset) { var res = s.slice(offset).match(re); - if (res) { - return offset + res.index; - } else { + if (res === null) { return -1; + } else { + return offset + res.index; } }; -- cgit v1.2.3