diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-07-12 22:20:20 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-07-12 22:20:20 +0200 |
commit | 79fc519eed9c053e4d347e085a862b9f856e8c2f (patch) | |
tree | 80efc500961e44e586fe3dfef66af3395d77ffbe /storage | |
parent | ef125e232d1f1700210977c8a774adb3698a857a (diff) | |
download | mariadb-git-79fc519eed9c053e4d347e085a862b9f856e8c2f.tar.gz |
json_udf slowdown
don't call strlen() in the loop
Diffstat (limited to 'storage')
-rw-r--r-- | storage/connect/json.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/storage/connect/json.cpp b/storage/connect/json.cpp index 75bf277b25b..3558c5762bb 100644 --- a/storage/connect/json.cpp +++ b/storage/connect/json.cpp @@ -767,7 +767,7 @@ bool JOUTSTR::Escape(const char *s) { WriteChr('"'); - for (unsigned int i = 0; i < strlen(s); i++) + for (unsigned int i = 0; s[i]; i++) switch (s[i]) { case '"': case '\\': @@ -816,7 +816,7 @@ bool JOUTFILE::Escape(const char *s) // This is temporary fputc('"', Stream); - for (unsigned int i = 0; i < strlen(s); i++) + for (unsigned int i = 0; s[i]; i++) switch (s[i]) { case '"': fputs("\\\"", Stream); break; case '\\': fputs("\\\\", Stream); break; |