From 246b7897714eacba4d9647d0c397a2454a81cf78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Nie=C3=9Fen?= Date: Fri, 3 Apr 2020 10:05:25 +0000 Subject: [PATCH] src: refactor to avoid goto in node_file.cc PR-URL: https://github.com/nodejs/node/pull/32637 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- src/node_file.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/node_file.cc b/src/node_file.cc index 54beb4e847fda1..0ce86287bb83e9 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -862,10 +862,8 @@ static void InternalModuleReadJSON(const FunctionCallbackInfo& args) { while (p < pe) { char c = *p++; - if (c == '"') goto quote; // Keeps code flat and inner loop small. if (c == '\\' && p < pe && *p == '"') p++; - continue; -quote: + if (c != '"') continue; *ppos++ = p; if (ppos < &pos[2]) continue; ppos = &pos[0];