You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2009/12/04 17:55:03 UTC

svn commit: r887264 - /lucene/lucy/trunk/core/Lucy/Object/Obj.c

Author: marvin
Date: Fri Dec  4 16:55:03 2009
New Revision: 887264

URL: http://svn.apache.org/viewvc?rev=887264&view=rev
Log:
Use CB_deserialize in Obj_deserialize now that it's available.

Modified:
    lucene/lucy/trunk/core/Lucy/Object/Obj.c

Modified: lucene/lucy/trunk/core/Lucy/Object/Obj.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/Obj.c?rev=887264&r1=887263&r2=887264&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/Obj.c (original)
+++ lucene/lucy/trunk/core/Lucy/Object/Obj.c Fri Dec  4 16:55:03 2009
@@ -60,18 +60,13 @@
 Obj_serialize(Obj *self, OutStream *outstream)
 {
     CharBuf *class_name = Obj_Get_Class_Name(self);
-    size_t size = CB_Get_Size(class_name);
-    OutStream_Write_C32(outstream, size);
-    OutStream_Write_Bytes(outstream, CB_Get_Ptr8(class_name), size);
+    CB_Serialize(class_name, outstream);
 }
 
 Obj*
 Obj_deserialize(Obj *self, InStream *instream)
 {
-    size_t size = InStream_Read_C32(instream);
-    CharBuf *class_name = CB_new(size);
-    CB_Set_Size(class_name, size);
-    InStream_Read_Bytes(instream, CB_Get_Ptr8(class_name), size);
+    CharBuf *class_name = CB_deserialize(NULL, instream);
     if (!self) {
         VTable *vtable = VTable_singleton(class_name, OBJ);
         self = VTable_Make_Obj(vtable);