Skip to content

Commit 56362f7

Browse files
committed
don't modify the static character replacement table
1 parent 00803c4 commit 56362f7

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

json/src/main/java/org/quiltmc/parsers/json/JsonWriter.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,17 +694,16 @@ private void string(String value, boolean quotes, boolean escapeQuotes) throws I
694694
out.write('\"');
695695
}
696696

697-
if (!escapeQuotes) {
698-
replacements['\"'] = null;
699-
}
700-
701697
int last = 0;
702698
int length = value.length();
703699

704700
for (int i = 0; i < length; i++) {
705701
char c = value.charAt(i);
706702
String replacement;
707703
if (c < 128) {
704+
if (c == '"' && !escapeQuotes) {
705+
continue;
706+
}
708707
replacement = replacements[c];
709708
if (replacement == null) {
710709
continue;

0 commit comments

Comments
 (0)