src: remove redundant string initialization
PR-URL: https://github.com/nodejs/node/pull/27152 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
845a6214f8
commit
ee7daf76c0
@ -233,7 +233,7 @@ std::string EscapeJsonChars(const std::string& str) {
|
|||||||
"\\u001a", "\\u001b", "\\u001c", "\\u001d", "\\u001e", "\\u001f"
|
"\\u001a", "\\u001b", "\\u001c", "\\u001d", "\\u001e", "\\u001f"
|
||||||
};
|
};
|
||||||
|
|
||||||
std::string ret = "";
|
std::string ret;
|
||||||
size_t last_pos = 0;
|
size_t last_pos = 0;
|
||||||
size_t pos = 0;
|
size_t pos = 0;
|
||||||
for (; pos < str.size(); ++pos) {
|
for (; pos < str.size(); ++pos) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user