Skip to content

Commit 246b789

Browse files
tniessentargos
authored andcommitted
src: refactor to avoid goto in node_file.cc
PR-URL: #32637 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent a25ceef commit 246b789

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/node_file.cc

+1-3
Original file line numberDiff line numberDiff line change
@@ -862,10 +862,8 @@ static void InternalModuleReadJSON(const FunctionCallbackInfo<Value>& args) {
862862

863863
while (p < pe) {
864864
char c = *p++;
865-
if (c == '"') goto quote; // Keeps code flat and inner loop small.
866865
if (c == '\\' && p < pe && *p == '"') p++;
867-
continue;
868-
quote:
866+
if (c != '"') continue;
869867
*ppos++ = p;
870868
if (ppos < &pos[2]) continue;
871869
ppos = &pos[0];

0 commit comments

Comments
 (0)