You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2013/08/27 00:51:18 UTC

[lucy-commits] [5/7] git commit: refs/heads/cfish-string-prep1 - Simplify S_do_consolidate in CompoundFileWriter

Simplify S_do_consolidate in CompoundFileWriter


Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/1a8ccea8
Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/1a8ccea8
Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/1a8ccea8

Branch: refs/heads/cfish-string-prep1
Commit: 1a8ccea84fa62444f635badc01562b518e2ca923
Parents: 5169be5
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Mon Aug 26 22:58:59 2013 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Aug 27 00:46:55 2013 +0200

----------------------------------------------------------------------
 core/Lucy/Store/CompoundFileWriter.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy/blob/1a8ccea8/core/Lucy/Store/CompoundFileWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Store/CompoundFileWriter.c b/core/Lucy/Store/CompoundFileWriter.c
index 89ed2c2..0337605 100644
--- a/core/Lucy/Store/CompoundFileWriter.c
+++ b/core/Lucy/Store/CompoundFileWriter.c
@@ -109,8 +109,6 @@ S_do_consolidate(CompoundFileWriter *self, CompoundFileWriterIVARS *ivars) {
     Hash_Store_Str(metadata, "format", 6,
                    (Obj*)CB_newf("%i32", CFWriter_current_file_format));
 
-    CharBuf *infilepath = CB_new(30);
-    size_t base_len = 0;
     VA_Sort(files, NULL, NULL);
     for (uint32_t i = 0, max = VA_Get_Size(files); i < max; i++) {
         CharBuf *infilename = (CharBuf*)VA_Fetch(files, i);
@@ -132,9 +130,7 @@ S_do_consolidate(CompoundFileWriter *self, CompoundFileWriterIVARS *ivars) {
                            (Obj*)CB_newf("%i64", offset));
             Hash_Store_Str(file_data, "length", 6,
                            (Obj*)CB_newf("%i64", len));
-            CB_Set_Size(infilepath, base_len);
-            CB_Cat(infilepath, infilename);
-            Hash_Store(sub_files, (Obj*)infilepath, (Obj*)file_data);
+            Hash_Store(sub_files, (Obj*)infilename, (Obj*)file_data);
             VA_Push(merged, INCREF(infilename));
 
             // Add filler NULL bytes so that every sub-file begins on a file
@@ -145,7 +141,6 @@ S_do_consolidate(CompoundFileWriter *self, CompoundFileWriterIVARS *ivars) {
             DECREF(instream);
         }
     }
-    DECREF(infilepath);
 
     // Write metadata to cfmeta file.
     CharBuf *cfmeta_temp = (CharBuf*)ZCB_WRAP_STR("cfmeta.json.temp", 16);