No need to recurse now that mergeEntries doesn't do any pattern matching.

This commit is contained in:
Dominik Picheta 2017-11-26 15:16:54 +00:00 • committed by Andreas Rumpf
commit 383c80971c
2 changed files with 4 additions and 3 deletions

View file

@ -248,9 +248,10 @@ proc mergeEntries(entries: seq[StackTraceEntry]): seq[StackTraceEntry] =
reRaiseEnd.inc()
assert entries[reRaiseEnd].procName.isNil
assert entries[reRaiseEnd].line == -100 # Signifies end of re-raise block.
let reRaisedEntries = mergeEntries(entries[i+1 .. reRaiseEnd-1])
let reRaisedEntries = entries[i+1 .. reRaiseEnd-1]
let (lastIndex, remainder) = diff(result, reRaisedEntries)
# Insert all the entries after lastIndex.
for i in 0..<remainder.len:
result.insert(remainder[i], lastIndex+i)
i = reRaiseEnd+1