#2433 - Postgres JSONB dirty checking - trim json

This commit is contained in:
Rob Bygrave committed 2021-11-26 16:34:15 +13:00
1 parent 268146df85
commit 63b9b42dc8
2 files changed
+46 -5

No files matched your search

@@ -19,8 +19,13 @@ final class JsonTrim {
for (int i = 0; i < len; i++) {
char c = json.charAt(i);
if (c == '\"') {
if (!escaped) quoted = !quoted;
else escaped = false;
if (!escaped) {
quoted = !quoted;
} else {
escaped = false;
}
} else if (escaped) {
escaped = false;
} else if (quoted && c == '\\') {
escaped = true;
}