lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r887264 - /lucene/lucy/trunk/core/Lucy/Object/Obj.c
Date Fri, 04 Dec 2009 16:55:03 GMT
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);



Mime
View raw message