File tree Expand file tree Collapse file tree 2 files changed +4
-24
lines changed Expand file tree Collapse file tree 2 files changed +4
-24
lines changed Original file line number Diff line number Diff line change 1212* .a
1313mkmf.log
1414perf.data
15+ perf.data.old
Original file line number Diff line number Diff line change @@ -13,27 +13,6 @@ class RubyObjectEncoder {
1313 StringBuffer buf;
1414 Writer<StringBuffer> writer;
1515
16- void test () {
17- writer.Key (" hello" );
18- writer.String (" world" );
19- writer.Key (" t" );
20- writer.Bool (true );
21- writer.Key (" f" );
22- writer.Bool (false );
23- writer.Key (" n" );
24- writer.Null ();
25- writer.Key (" i" );
26- writer.Uint (123 );
27- writer.Key (" pi" );
28- writer.Double (3.1416 );
29- writer.Key (" a" );
30- writer.StartArray ();
31- for (unsigned i = 0 ; i < 4 ; i++)
32- writer.Uint (i);
33- writer.EndArray ();
34- writer.EndObject ();
35- }
36-
3716 void encode_array (VALUE ary) {
3817 writer.StartArray ();
3918 int length = RARRAY_LEN (ary);
@@ -48,7 +27,7 @@ class RubyObjectEncoder {
4827 void encode_key (VALUE key) {
4928 switch (rb_type (key)) {
5029 case T_STRING:
51- writer.Key (RSTRING_PTR (key), RSTRING_LEN (key));
30+ writer.Key (RSTRING_PTR (key), RSTRING_LEN (key), false );
5231 return ;
5332 default :
5433 raise_unknown (key);
@@ -73,7 +52,7 @@ class RubyObjectEncoder {
7352 }
7453
7554 void encode_fixnum (VALUE v) {
76- writer.Int (RB_FIX2INT (v));
55+ writer.Int (FIX2LONG (v));
7756 }
7857
7958 void encode_float (VALUE v) {
@@ -83,7 +62,7 @@ class RubyObjectEncoder {
8362
8463 void encode_string (VALUE v) {
8564 // fixme: copy boolean?
86- writer.String (RSTRING_PTR (v), RSTRING_LEN (v));
65+ writer.String (RSTRING_PTR (v), RSTRING_LEN (v), false );
8766 }
8867
8968 void encode_any (VALUE v) {
You can’t perform that action at this time.
0 commit comments