Skip to content

Commit f4dfbeb

Browse files
tniessenaddaleax
authored andcommitted
src: refactor to avoid goto in node_file.cc
PR-URL: #32637 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 1c816f0 commit f4dfbeb

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/node_file.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -878,10 +878,8 @@ static void InternalModuleReadJSON(const FunctionCallbackInfo<Value>& args) {
878878

879879
while (p < pe) {
880880
char c = *p++;
881-
if (c == '"') goto quote; // Keeps code flat and inner loop small.
882881
if (c == '\\' && p < pe && *p == '"') p++;
883-
continue;
884-
quote:
882+
if (c != '"') continue;
885883
*ppos++ = p;
886884
if (ppos < &pos[2]) continue;
887885
ppos = &pos[0];

0 commit comments

Comments
 (0)