Check-in [8857e1eabb]
Not logged in
Overview

SHA1 Hash:8857e1eabbea1466c7d194d9db3381e501ef4540
Date: 2007-08-28 05:00:20
User: aku
Comment:Fixed typos, and extended the documentation of content_deltify.
Timelines: ancestors | descendants | both | trunk
Other Links: files | ZIP archive | manifest

Tags And Properties
Changes
[hide diffs]

Modified src/content.c from [896054a3e4] to [60a9520d47].

@@ -175,12 +175,12 @@
   db_prepare(&s1, "SELECT rid, size FROM blob WHERE uuid=%B", &hash);
   if( db_step(&s1)==SQLITE_ROW ){
     rid = db_column_int(&s1, 0);
     if( db_column_int(&s1, 1)>=0 || pBlob==0 ){
       /* Either the entry is not a phantom or it is a phantom but we
-      ** have no data with which to dephathomize it.  In either case,
-      ** there is nothing for use to do other than return the RID. */
+      ** have no data with which to dephantomize it.  In either case,
+      ** there is nothing for us to do other than return the RID. */
       db_finalize(&s1);
       db_end_transaction(0);
       return rid;
     }
   }else{
@@ -307,10 +307,19 @@
 ** If rid is already a delta from some other place then no
 ** conversion occurs and this is a no-op unless force==1.
 **
 ** If srcid is a delta that depends on rid, then srcid is
 ** converted to undeltaed text.
+**
+** If either rid or srcid contain less than 50 bytes, or if the
+** resulting delta does not achieve a compression of at least 25% on
+** its own the rid is left untouched.
+**
+** NOTE: IMHO the creation of the delta should be defered until after
+** the blob sizes have been checked. Doing it before the check as is
+** done now the code will generate a delta just to immediately throw
+** it away, wasting space and time.
 */
 void content_deltify(int rid, int srcid, int force){
   int s;
   Blob data, src, delta;
   Stmt s1, s2;