From 1f646761898876cd2bf8a707fb2b98a777188d0e Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Fri, 21 Aug 2015 12:14:10 -0700 Subject: [PATCH] :fire: Unnecessary joining and splitting --- spec/atom-reporter.coffee | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/spec/atom-reporter.coffee b/spec/atom-reporter.coffee index 5cd700c39..5e52b4b9b 100644 --- a/spec/atom-reporter.coffee +++ b/spec/atom-reporter.coffee @@ -9,13 +9,10 @@ formatStackTrace = (spec, message='', stackTrace) -> jasminePattern = /^\s*at\s+.*\(?.*[/\\]jasmine(-[^/\\]*)?\.js:\d+:\d+\)?\s*$/ firstJasmineLinePattern = /^\s*at [/\\].*[/\\]jasmine(-[^/\\]*)?\.js:\d+:\d+\)?\s*$/ - convertedLines = [] + lines = [] for line in stackTrace.split('\n') - convertedLines.push(line) unless jasminePattern.test(line) + lines.push(line) unless jasminePattern.test(line) break if firstJasmineLinePattern.test(line) - stackTrace = convertedLines.join('\n') - - lines = stackTrace.split('\n') # Remove first line of stack when it is the same as the error message errorMatch = lines[0]?.match(/^Error: (.*)/)