From 07a0dc89ad14e87ca343d9f94636921e8710536c Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Mon, 21 Jan 2019 15:16:48 +0100 Subject: [PATCH] report: roll extra loop iteration in `PrintNativeStack()` PR-URL: https://github.com/nodejs/node/pull/25610 Reviewed-By: Colin Ihrig Reviewed-By: Richard Lau --- src/node_report.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/node_report.cc b/src/node_report.cc index 9b936a506d332a..db269903e040ff 100644 --- a/src/node_report.cc +++ b/src/node_report.cc @@ -500,17 +500,13 @@ static void PrintNativeStack(JSONWriter* writer) { writer->json_arraystart("nativeStack"); int i; std::ostringstream buf; - for (i = 1; i < size - 1; i += 1) { + for (i = 1; i < size; i++) { void* frame = frames[i]; buf.str(""); buf << " [pc=" << frame << "] "; buf << sym_ctx->LookupSymbol(frame).Display().c_str(); writer->json_element(buf.str()); } - buf.str(""); - buf << " [pc=" << frames[i] << "] "; - buf << sym_ctx->LookupSymbol(frames[i]).Display().c_str(); - writer->json_element(buf.str()); writer->json_arrayend(); }