Fossil SCM
Fixed typos, and extended the documentation of content_deltify.
Commit
8857e1eabbea1466c7d194d9db3381e501ef4540
Parent
103c397e4b36b1d…
1 file changed
+11
-2
+11
-2
| --- src/content.c | ||
| +++ src/content.c | ||
| @@ -175,12 +175,12 @@ | ||
| 175 | 175 | db_prepare(&s1, "SELECT rid, size FROM blob WHERE uuid=%B", &hash); |
| 176 | 176 | if( db_step(&s1)==SQLITE_ROW ){ |
| 177 | 177 | rid = db_column_int(&s1, 0); |
| 178 | 178 | if( db_column_int(&s1, 1)>=0 || pBlob==0 ){ |
| 179 | 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. */ | |
| 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 | 182 | db_finalize(&s1); |
| 183 | 183 | db_end_transaction(0); |
| 184 | 184 | return rid; |
| 185 | 185 | } |
| 186 | 186 | }else{ |
| @@ -307,10 +307,19 @@ | ||
| 307 | 307 | ** If rid is already a delta from some other place then no |
| 308 | 308 | ** conversion occurs and this is a no-op unless force==1. |
| 309 | 309 | ** |
| 310 | 310 | ** If srcid is a delta that depends on rid, then srcid is |
| 311 | 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. | |
| 312 | 321 | */ |
| 313 | 322 | void content_deltify(int rid, int srcid, int force){ |
| 314 | 323 | int s; |
| 315 | 324 | Blob data, src, delta; |
| 316 | 325 | Stmt s1, s2; |
| 317 | 326 |
| --- 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 |