diff options
author | Joey Adams | 2011-03-28 06:01:03 +0000 |
---|---|---|
committer | Joey Adams | 2011-03-28 14:51:34 +0000 |
commit | 01875fe5699df006a7cc9474e0ef1579817c8d5c (patch) | |
tree | b5f5c06207b1604e202caeebfdfb428523cc45be | |
parent | 3f60c8123bfa30b88bf5b78cceff91153cb51110 (diff) |
[cleanup] json.c: Rename `StringInfoData ret` to `StringInfoData buf`
-rw-r--r-- | json.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -232,13 +232,13 @@ json_condense(const char *json_str, size_t length, size_t *out_length) { const char *s = json_str; const char *e = s + length; - StringInfoData ret; + StringInfoData buf; bool inside_string = false; bool server_encoding_is_utf8 = GetDatabaseEncoding() == PG_UTF8; Assert(json_validate(json_str, length)); - initStringInfo(&ret); + initStringInfo(&buf); while (s < e) { @@ -260,7 +260,7 @@ json_condense(const char *json_str, size_t length, size_t *out_length) /* Change \/ to / */ if (s[1] == '/') { - appendStringInfoChar(&ret, '/'); + appendStringInfoChar(&buf, '/'); s += 2; continue; } @@ -269,8 +269,8 @@ json_condense(const char *json_str, size_t length, size_t *out_length) * to avoid getting mixed up by \\ and \" */ if (s[1] != 'u') { - appendStringInfoChar(&ret, s[0]); - appendStringInfoChar(&ret, s[1]); + appendStringInfoChar(&buf, s[0]); + appendStringInfoChar(&buf, s[1]); s += 2; continue; } @@ -285,7 +285,7 @@ json_condense(const char *json_str, size_t length, size_t *out_length) if (uc >= 0x20 && uc <= 0x7E) { s += 6; - appendStringInfoChar(&ret, uc); + appendStringInfoChar(&buf, uc); continue; } @@ -309,7 +309,7 @@ json_condense(const char *json_str, size_t length, size_t *out_length) lc >= 0xDC00 && lc <= 0xDFFF) { s += 12; - appendStringInfoUtf8(&ret, from_surrogate_pair(uc, lc)); + appendStringInfoUtf8(&buf, from_surrogate_pair(uc, lc)); continue; } } @@ -317,7 +317,7 @@ json_condense(const char *json_str, size_t length, size_t *out_length) else { s += 6; - appendStringInfoUtf8(&ret, uc); + appendStringInfoUtf8(&buf, uc); continue; } } @@ -335,14 +335,14 @@ json_condense(const char *json_str, size_t length, size_t *out_length) } /* If we get here, it means we want to emit this character as is. */ - appendStringInfoChar(&ret, *s); + appendStringInfoChar(&buf, *s); if (*s++ == '"') inside_string = !inside_string; } if (out_length != NULL) - *out_length = ret.len; - return ret.data; + *out_length = buf.len; + return buf.data; } /* |