Fossil SCM

Fixed typos, and extended the documentation of content_deltify.

aku 2007-08-28 05:00 trunk
Commit 8857e1eabbea1466c7d194d9db3381e501ef4540
1 file changed +11 -2
+11 -2
--- src/content.c
+++ src/content.c
@@ -175,12 +175,12 @@
175175
db_prepare(&s1, "SELECT rid, size FROM blob WHERE uuid=%B", &hash);
176176
if( db_step(&s1)==SQLITE_ROW ){
177177
rid = db_column_int(&s1, 0);
178178
if( db_column_int(&s1, 1)>=0 || pBlob==0 ){
179179
/* Either the entry is not a phantom or it is a phantom but we
180
- ** have no data with which to dephathomize it. In either case,
181
- ** there is nothing for use to do other than return the RID. */
180
+ ** have no data with which to dephantomize it. In either case,
181
+ ** there is nothing for us to do other than return the RID. */
182182
db_finalize(&s1);
183183
db_end_transaction(0);
184184
return rid;
185185
}
186186
}else{
@@ -307,10 +307,19 @@
307307
** If rid is already a delta from some other place then no
308308
** conversion occurs and this is a no-op unless force==1.
309309
**
310310
** If srcid is a delta that depends on rid, then srcid is
311311
** converted to undeltaed text.
312
+**
313
+** If either rid or srcid contain less than 50 bytes, or if the
314
+** resulting delta does not achieve a compression of at least 25% on
315
+** its own the rid is left untouched.
316
+**
317
+** NOTE: IMHO the creation of the delta should be defered until after
318
+** the blob sizes have been checked. Doing it before the check as is
319
+** done now the code will generate a delta just to immediately throw
320
+** it away, wasting space and time.
312321
*/
313322
void content_deltify(int rid, int srcid, int force){
314323
int s;
315324
Blob data, src, delta;
316325
Stmt s1, s2;
317326
--- src/content.c
+++ src/content.c
@@ -175,12 +175,12 @@
175 db_prepare(&s1, "SELECT rid, size FROM blob WHERE uuid=%B", &hash);
176 if( db_step(&s1)==SQLITE_ROW ){
177 rid = db_column_int(&s1, 0);
178 if( db_column_int(&s1, 1)>=0 || pBlob==0 ){
179 /* Either the entry is not a phantom or it is a phantom but we
180 ** have no data with which to dephathomize it. In either case,
181 ** there is nothing for use to do other than return the RID. */
182 db_finalize(&s1);
183 db_end_transaction(0);
184 return rid;
185 }
186 }else{
@@ -307,10 +307,19 @@
307 ** If rid is already a delta from some other place then no
308 ** conversion occurs and this is a no-op unless force==1.
309 **
310 ** If srcid is a delta that depends on rid, then srcid is
311 ** converted to undeltaed text.
 
 
 
 
 
 
 
 
 
312 */
313 void content_deltify(int rid, int srcid, int force){
314 int s;
315 Blob data, src, delta;
316 Stmt s1, s2;
317
--- src/content.c
+++ src/content.c
@@ -175,12 +175,12 @@
175 db_prepare(&s1, "SELECT rid, size FROM blob WHERE uuid=%B", &hash);
176 if( db_step(&s1)==SQLITE_ROW ){
177 rid = db_column_int(&s1, 0);
178 if( db_column_int(&s1, 1)>=0 || pBlob==0 ){
179 /* Either the entry is not a phantom or it is a phantom but we
180 ** have no data with which to dephantomize it. In either case,
181 ** there is nothing for us to do other than return the RID. */
182 db_finalize(&s1);
183 db_end_transaction(0);
184 return rid;
185 }
186 }else{
@@ -307,10 +307,19 @@
307 ** If rid is already a delta from some other place then no
308 ** conversion occurs and this is a no-op unless force==1.
309 **
310 ** If srcid is a delta that depends on rid, then srcid is
311 ** converted to undeltaed text.
312 **
313 ** If either rid or srcid contain less than 50 bytes, or if the
314 ** resulting delta does not achieve a compression of at least 25% on
315 ** its own the rid is left untouched.
316 **
317 ** NOTE: IMHO the creation of the delta should be defered until after
318 ** the blob sizes have been checked. Doing it before the check as is
319 ** done now the code will generate a delta just to immediately throw
320 ** it away, wasting space and time.
321 */
322 void content_deltify(int rid, int srcid, int force){
323 int s;
324 Blob data, src, delta;
325 Stmt s1, s2;
326

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button