diff options
author | Tobias Nießen <tniessen@tnie.de> | 2020-04-03 13:05:25 +0300 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2020-04-11 11:12:57 +0300 |
commit | 246b7897714eacba4d9647d0c397a2454a81cf78 (patch) | |
tree | 49c1962007e8b39e134f6f26a21a7e7bbdc9fcd2 /src/node_file.cc | |
parent | a25ceeff7269f6bb3e9d34e2c6d4d17800e8b703 (diff) |
src: refactor to avoid goto in node_file.cc
PR-URL: https://github.com/nodejs/node/pull/32637
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/node_file.cc')
-rw-r--r-- | src/node_file.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/node_file.cc b/src/node_file.cc index 54beb4e847f..0ce86287bb8 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -862,10 +862,8 @@ static void InternalModuleReadJSON(const FunctionCallbackInfo<Value>& 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]; |