Commit 79fc519e authored by Sergei Golubchik's avatar Sergei Golubchik

json_udf slowdown

don't call strlen() in the loop
parent ef125e23
...@@ -767,7 +767,7 @@ bool JOUTSTR::Escape(const char *s) ...@@ -767,7 +767,7 @@ bool JOUTSTR::Escape(const char *s)
{ {
WriteChr('"'); WriteChr('"');
for (unsigned int i = 0; i < strlen(s); i++) for (unsigned int i = 0; s[i]; i++)
switch (s[i]) { switch (s[i]) {
case '"': case '"':
case '\\': case '\\':
...@@ -816,7 +816,7 @@ bool JOUTFILE::Escape(const char *s) ...@@ -816,7 +816,7 @@ bool JOUTFILE::Escape(const char *s)
// This is temporary // This is temporary
fputc('"', Stream); fputc('"', Stream);
for (unsigned int i = 0; i < strlen(s); i++) for (unsigned int i = 0; s[i]; i++)
switch (s[i]) { switch (s[i]) {
case '"': fputs("\\\"", Stream); break; case '"': fputs("\\\"", Stream); break;
case '\\': fputs("\\\\", Stream); break; case '\\': fputs("\\\\", Stream); break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment