File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed
Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -249,11 +249,11 @@ void encodeBasicSWAR(ByteList src) throws IOException {
249249
250250 if (pos + 4 <= len ) {
251251 int x = bb .getInt (ptr + pos );
252- int is_ascii = 0x808080 & ~x ;
253- int xor2 = x ^ 0x020202 ;
254- int lt32_or_eq34 = xor2 - 0x212121 ;
255- int sub92 = x ^ 0x5C5C5C ;
256- int eq92 = (sub92 - 0x010101 );
252+ int is_ascii = 0x80808080 & ~x ;
253+ int xor2 = x ^ 0x02020202 ;
254+ int lt32_or_eq34 = xor2 - 0x21212121 ;
255+ int sub92 = x ^ 0x5C5C5C5C ;
256+ int eq92 = (sub92 - 0x01010101 );
257257 boolean skip_chunk = ((lt32_or_eq34 | eq92 ) & is_ascii ) == 0 ;
258258 if (skip_chunk ) {
259259 pos += 4 ;
Original file line number Diff line number Diff line change @@ -504,6 +504,18 @@ def test_backslash
504504 json = '["\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\""]'
505505 assert_equal json , generate ( data )
506506 #
507+ data = '"""""'
508+ json = '"\"\"\"\"\""'
509+ assert_equal json , generate ( data )
510+ #
511+ data = "abc\n "
512+ json = '"abc\\n"'
513+ assert_equal json , generate ( data )
514+ #
515+ data = "\n abc"
516+ json = '"\\nabc"'
517+ assert_equal json , generate ( data )
518+ #
507519 data = [ "'" ]
508520 json = '["\\\'"]'
509521 assert_equal '["\'"]' , generate ( data )
You can’t perform that action at this time.
0 commit comments