Skip to content

Commit a502209

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 2c5b014 commit a502209

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
@@ -825,10 +825,8 @@ static void InternalModuleReadJSON(const FunctionCallbackInfo<Value>& args) {
825825

826826
while (p < pe) {
827827
char c = *p++;
828-
if (c == '"') goto quote; // Keeps code flat and inner loop small.
829828
if (c == '\\' && p < pe && *p == '"') p++;
830-
continue;
831-
quote:
829+
if (c != '"') continue;
832830
*ppos++ = p;
833831
if (ppos < &pos[2]) continue;
834832
ppos = &pos[0];

0 commit comments

Comments
 (0)